{"id":633,"date":"2023-08-29T13:00:10","date_gmt":"2023-08-29T13:00:10","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/08\/29\/8306612-how-to-use-the-docker-vps-template-at-hostinger\/"},"modified":"2026-03-16T12:12:02","modified_gmt":"2026-03-16T12:12:02","slug":"8306612-how-to-use-the-docker-vps-template-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8306612-how-to-use-the-docker-vps-template-at-hostinger\/","title":{"rendered":"How to Use the Docker VPS Template at Hostinger"},"content":{"rendered":"<p class=\"no-margin\"><b><a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Docker<\/a><\/b> is a containerization platform that allows the creation of consistent, isolated environments working seamlessly across various computing environments, from development to production.<\/p><p class=\"no-margin\">At <b>Hostinger<\/b>, we have an <b><a href=\"\/support\/1583571-what-are-the-available-operating-systems-for-vps#h_ea21916da6\" target=\"_blank\" class=\"intercom-content-link\">Ubuntu 24.04 VPS template<\/a><\/b> with both <code>docker-ce<\/code> and <code>docker-compose<\/code> pre-installed, making it easy for you to start deploying and managing your applications using Docker containers.<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">If you don&rsquo;t have a VPS yet, you can check the available options here: <b><a href=\"https:\/\/www.hostinger.com\/vps\/docker-hosting\" target=\"_blank\" class=\"intercom-content-link\">Docker hosting<\/a> <\/b>&#128161;<\/p>\n<\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To start using Docker, <b><a href=\"\/support\/4965922-how-to-change-the-operating-system-for-your-vps\" target=\"_blank\" class=\"intercom-content-link\">install the Docker template<\/a><\/b> and follow these steps:<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_e833e83acd\">Connect to Your VPS<\/h2><p class=\"no-margin\">Open <b>Terminal <\/b>(Linux\/macOS) or <b>Command Prompt\/PowerShell<\/b> (Windows) on your local computer and enter the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>ssh root@vps_ip<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Replace <b>vps_ip<\/b> with your <b><a href=\"\/support\/5139756-how-to-find-your-vps-ip-address\" target=\"_blank\" class=\"intercom-content-link\">VPS IP address<\/a><\/b>. You might be prompted to enter your VPS password.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_6aaee9107f\">Check the Docker Installation<\/h2><p class=\"no-margin\">To verify that <b>Docker is installed<\/b>, enter the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker --version<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">You will get the <b>Docker <\/b>version information if it&rsquo;s installed correctly. Now check <b>Docker Compose<\/b> with the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker-compose --version<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">If installed correctly, this will display the version of Docker Compose.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_94dbda9a75\">Deploy Your First Docker Container<\/h2><p class=\"no-margin\">Pull a <b>sample Docker image<\/b> to test your setup. For instance, you can use the &ldquo;Hello World&rdquo; image:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker run hello-world<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This command will download and run the &ldquo;Hello World&rdquo; container.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_19659d52b1\">Start Using Docker Compose<\/h2><p class=\"no-margin\">Create a new directory for your Docker Compose project and navigate to it:<\/p><p class=\"no-margin\">\n<\/p><pre><code>mkdir my-docker-project<br>cd my-docker-project<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Once inside your project directory, create a <b>docker-compose.yml<\/b> file using a text editor and define your services, networks, and volumes. Now you can start your services using the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker-compose up -d<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">This will start the services defined in your Docker Compose configuration by reading the configuration from the <b>docker-compose.yml<\/b> file in the current directory. The <b>-d<\/b> flag stands for <b>detached <\/b>so<b> <\/b>that the command runs in the background and returns to the command line instead of showing the logs of the running services.<\/p><p class=\"no-margin\">\n<\/p><h3 id=\"h_f9d58ce16b\">Managing Docker Compose Services<\/h3><p class=\"no-margin\">To <b>stop <\/b>your Docker Compose services, use the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker-compose down<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To <b>list <\/b>all running containers, use:<\/p><p class=\"no-margin\">\n<\/p><pre><code>docker ps<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">That&rsquo;s it! Now you know how to use Docker in your Hostinger VPS.<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">Make sure to explore the official <b><a href=\"https:\/\/docs.docker.com\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Docker documentation<\/a><\/b> and resources to learn more about <b>optimizing and securing<\/b> your containerized applications &#128161;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Getting started with Hostinger VPS Docker template<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[206],"tags":[],"class_list":["post-633","post","type-post","status-publish","format-standard","hentry","category-vps-os-and-templates"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8306612-how-to-use-the-docker-vps-template-at-hostinger\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=633"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/633\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}