{"id":1037,"date":"2018-11-30T16:11:33","date_gmt":"2018-11-30T16:11:33","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=1037"},"modified":"2021-11-14T23:06:06","modified_gmt":"2021-11-14T23:06:06","slug":"install-use-docker-compose-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/","title":{"rendered":"How to Install &#038; Use Docker Compose on Ubuntu 18.04"},"content":{"rendered":"<p><a href=\"https:\/\/docs.docker.com\/compose\/\" target=\"_blank\" rel=\"noopener\">Docker Compose<\/a> is a tool that helps you define and run multi-container applications. Instead of you building, running and connecting containers from separate Dockerfiles, it allows you to use a YAML file (called the Compose file) to define all of your application&#8217;s services, after which you can create and start them by using a single command.<\/p>\n<p>Some of the most popular uses of Docker Compose include single application deployments, automated testing and local development.<\/p>\n<p>In this tutorial we&#8217;ll learn how to install Docker Compose by the end of it, you should have a basic understanding of some of its&#8217; commands and how it works.<\/p>\n<p><strong>NOTE:<\/strong> Even though this tutorial is written for Ubuntu 18.04, the commands should apply to other operating systems as well.<\/p>\n<p><strong>Prerequisites<\/strong><\/p>\n<ol>\n<li>A <strong>non-root sudo user<\/strong>. You can check our tutorial [<a href=\"https:\/\/draculaservers.com\/tutorials\/create-sudo-user-ubuntu\/\">How to Create a Sudo User on Ubuntu<\/a>] to see how to set it up.<\/li>\n<li><strong>Docker installed<\/strong> and optionally allowing non-sudo access to Docker. To do this, you can follow <strong>Step 1<\/strong> and <strong>Step 2<\/strong> from our previous tutorial &#8211; [<a href=\"https:\/\/draculaservers.com\/tutorials\/install-docker-ubuntu-18-04\/\">How to Install &amp; Use Docker on Ubuntu 18.04<\/a>]<\/li>\n<\/ol>\n<p><strong>NOTE:<\/strong> Since it&#8217;s optional for readers to allow non-sudo access to Docker, the command examples will have <code>sudo<\/code> appended to the <code>docker<\/code> command, for those who have not enabled non-sudo access.<\/p>\n\n<h2 id=\"step-1-install-docker-compose\">Step 1 \u2014 Install Docker Compose<\/h2>\n<p>Check the latest Docker Compose releases here https:\/\/github.com\/docker\/compose\/releases, and replace the version in the following command ( <code>1.23.2<\/code> ) with the version you see tagged as the <code>Latest release<\/code>, to download the latest version:<\/p>\n<pre lang=\"bash\"><code>$ sudo curl -L https:\/\/github.com\/docker\/compose\/releases\/download\/1.21.2\/docker-compose-<code>uname -s<\/code>-<code>uname -m<\/code> -o \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>Set executable permissions to the Docker Compose binary:<\/p>\n<pre lang=\"bash\"><code>$ sudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>Check if the installation was successful by checking the Compose version:<\/p>\n<pre lang=\"bash\"><code>$ docker-compose --version<\/code><\/pre>\n<p>The output should look something like this:<\/p>\n<p><code>docker-compose version 1.23.2, build 1110ad01<\/code><\/p>\n<h2 id=\"step-2-docker-compose-basics\">Step 2 \u2014 Docker Compose Basics<\/h2>\n<p>With Docker Compose installed we can get to running our first container using it. We&#8217;ll use the well known <strong>Hello World<\/strong> example. To do this we&#8217;ll create our first <strong>Compose file<\/strong>.<\/p>\n<p>The Compose files are <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/YAML\" target=\"_blank\" rel=\"noopener\">YAML<\/a><\/strong> files, and one of the default names that Docker Compose looks for is called <code>docker-compose.yml<\/code>.<\/p>\n<blockquote class=\"note\"><p><small>If you want to name the Compose file something else, then you have to use the <code>-f<\/code> argument followed by the alternate file name.<\/small><\/p><\/blockquote>\n<p>Now let&#8217;s create a directory for the YAML file and move into it:<\/p>\n<pre lang=\"bash\"><code>$ mkdir hello-world\n$ cd hello-world<\/code><\/pre>\n<p>Use your preferred text editor and create the <code>docker-compose.yml<\/code> file:<\/p>\n<pre lang=\"bash\"><code>$ nano docker-compose.yml<\/code><\/pre>\n<p>Add the following contents in the file:<\/p>\n<pre lang=\"yaml\"><code>my-test:\n  image: hello-world<\/code><\/pre>\n<p>Let&#8217;s see what each line means:<\/p>\n<p>&#8211; <code>my-test<\/code> &#8211; will be used as part of the container name<br \/>\n&#8211; <code>image: hello-world<\/code> &#8211; we&#8217;re telling Docker Compose to use the <strong>image<\/strong> by the name <strong>hello-world<\/strong>. Just like when we use <code>docker run hello-world<\/code>, it will search locally and if it doesn&#8217;t find it, it&#8217;ll try to <code>pull<\/code> it from Docker Hub.<\/p>\n<p>Save and exit the file when you&#8217;re finished.<\/p>\n<p>While we&#8217;re still in the <code>~\/hello-world<\/code> directory, we&#8217;ll execute the following command:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker-compose up<\/code><\/pre>\n<p>Now, just like when running <code>docker run hello-world<\/code>, it&#8217;ll search locally for the <strong>hello-world<\/strong> image, and download it from Docker Hub if it doesn&#8217;t find it.<\/p>\n<p>The output will look something like this when it&#8217;s finished:<\/p>\n<pre><code>Pulling my-test (hello-world:)...\nlatest: Pulling from library\/hello-world\nd1725b59e92d: Pull complete\nCreating hello-world_my-test_1 ... done\nAttaching to hello-world_my-test_1\n...<\/code><\/pre>\n<p>After pulling the image, Docker Compose creates a container from it, attaches, and runs the [<a href=\"https:\/\/github.com\/docker-library\/hello-world\/blob\/85fd7ab65e079b08019032479a3f306964a28f4d\/hello-world\/Dockerfile\" target=\"_blank\" rel=\"noopener\">hello<\/a>] program, which then outputs the message confirming that the installation is working and explains the steps that Docker ran through:<\/p>\n<pre><code>...\nmy-test_1  | \nmy-test_1  | Hello from Docker!\nmy-test_1  | This message shows that your installation appears to be working correctly.\nmy-test_1  | \nmy-test_1  | To generate this message, Docker took the following steps:\nmy-test_1  |  1. The Docker client contacted the Docker daemon.\nmy-test_1  |  2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\nmy-test_1  |     (amd64)\nmy-test_1  |  3. The Docker daemon created a new container from that image which runs the\nmy-test_1  |     executable that produces the output you are currently reading.\nmy-test_1  |  4. The Docker daemon streamed that output to the Docker client, which sent it\nmy-test_1  |     to your terminal.\n...<\/code><\/pre>\n<p>Since Docker containers only run as long as the command is active, the container stopped after the <code>hello<\/code> program finished running.<\/p>\n<p>We can see that the container is stopped by checking <code>active<\/code> containers:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker ps<\/code><\/pre>\n<p><small>Output:<\/small><\/p>\n<pre><code>CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES<\/code><\/pre>\n<p>And if we check all of the containers, by using the <code>-a<\/code> flag, we can see the container created:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker ps -a<\/code><\/pre>\n<p><small>Output:<\/small><\/p>\n<pre><code>CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                         PORTS               NAMES\n17cd42c3da63        hello-world         \"\/hello\"            About an hour ago   Exited (0) About an hour ago                       hello-world_my-test_1<\/code><\/pre>\n<p>Using this information, we can remove the container when we&#8217;re done with it, to keep things clean. We can remove the container by using the <code>docker rm<\/code> command, followed by the <strong>name<\/strong> or <strong>ID<\/strong> of the container:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker rm hello-world_my-test_1<\/code><\/pre>\n<p><strong>OR<\/strong><\/p>\n<pre lang=\"bash\"><code>$ sudo docker rm 17cd42c3da63<\/code><\/pre>\n<p>When all the containers referencing an image are removed, we can also remove the image by using the <code>docker rmi<\/code> command:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker rmi hello-world<\/code><\/pre>\n<blockquote class=\"note\"><p><small>You can check out the details and examples on how the <code>rmi<\/code> subcommand works in the <a href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/rmi\/#examples\" target=\"_blank\" rel=\"noopener\">official Docker documentation<\/a><\/small><\/p><\/blockquote>\n<h2 id=\"step-3-docker-compose-commands\">Step 3 \u2014 Docker Compose Commands<\/h2>\n<p>So we ran <code>docker-compose up<\/code> to run a container which ran the <code>hello<\/code> program that displayed the output message and then exited. This is not ideal, however. What we want is for <code>docker-compose<\/code> to act more like a service.<\/p>\n<p>The <strong>Hello World<\/strong> container exits after it&#8217;s run, so we&#8217;ll need a container that keeps running.<\/p>\n<h4 id=\"starting-a-container-as-a-background-process\">Starting a Container as a Background Process<\/h4>\n<p>For this example we&#8217;ll use <strong>nginx<\/strong>.<\/p>\n<p>Let&#8217;s set up a new directory for <strong>nginx<\/strong> and move into it:<\/p>\n<pre lang=\"bash\"><code>$ mkdir ~\/nginx\n$ cd ~\/nginx<\/code><\/pre>\n<p>Now create the <code>docker-compose.yml<\/code>file and paste the following content:<\/p>\n<pre lang=\"yaml\"><code>nginx:\n  image: nginx<\/code><\/pre>\n<p>Save and exit the file when you&#8217;re finished.<\/p>\n<p>Now we&#8217;ll run the <strong>nginx<\/strong> container as a background process by running <code>docker-compose up<\/code> and by adding the <code>-d<\/code> switch, which tells it do <code>detach<\/code>.<\/p>\n<blockquote class=\"note\"><p><small><strong>NOTE:<\/strong> If we don&#8217;t add the <code>-d<\/code> switch, then we&#8217;d have to type <code>Ctrl+C<\/code> to exit the process.<\/small><\/p><\/blockquote>\n<p>To start the container and detach, run:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker-compose up -d<\/code><\/pre>\n<p>The <strong>nginx<\/strong> image will be downloaded and the container will be started in the background.<\/p>\n<p>We can see our active containers with the command:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker ps<\/code><\/pre>\n<p>The output looks something like this:<\/p>\n<pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES\nff9d47aa7014        nginx               \"nginx -g 'daemon of\u2026\"   9 minutes ago       Up 3 seconds        80\/tcp              nginx_nginx_1<\/code><\/pre>\n<h4 id=\"interacting-with-a-running-container\">Interacting with a Running Container<\/h4>\n<p>If you need to interact with a running container, we can do so by using the <code>docker exec<\/code> command, followed by its&#8217; <strong>ID<\/strong> or <strong>name<\/strong>, to start a shell inside the running container:<\/p>\n<pre lang=\"bash\"><code>$ sudo docker exec -it nginx_nginx_1 \/bin\/bash<\/code><\/pre>\n<p>The <code>-t<\/code> switch opens up a terminal, the <code>-i<\/code> switch makes it interactive, and by using the <code>\/bin\/bash<\/code> option we&#8217;re opening a bash shell in the running container.<\/p>\n<p>You&#8217;ll notice your prompt change to <code>root@container_id:\/#<\/code> :<\/p>\n<pre lang=\"bash\"><code>root@ff9d47aa7014:\/#<\/code><\/pre>\n<p>You can now work from the command prompt.<\/p>\n<p><strong>IMPORTANT:<\/strong> Keep in mind, however, that unless you are in a directory that is part of a <code>data volume<\/code> ( a linked path on the <strong>host machine<\/strong> that can be used by the container ) , your changes will disappear when the container restarts.<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>That covers installing Docker Compose and a basic usage of it, however there&#8217;s more to learn in order to really have fun with it.<\/p>\n<p>To see the full list of configuration options for the <code>docker-compose.yml<\/code> file, please check the official Docker Documentation and refer to the <a href=\"https:\/\/docs.docker.com\/compose\/compose-file\/\" target=\"_blank\" rel=\"noopener\">Compose file reference<\/a>.<\/p>\n<p>If you&#8217;ve found any issues with this tutorial, or have any questions, then please do not hesitate to contact us.<\/p>\n<p>Also, if you&#8217;re looking for a high performance VPS, then do check out our <a href=\"https:\/\/draculasevers.com\/kvm.php\" target=\"_blank\" rel=\"noopener\">KVM SSD Plans<\/a>. Our offer starts at <strong>1GB RAM + 10GB SSD at just $9.99\/mo<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker Compose is a tool that helps you define and run multi-container applications. Instead of you building, running and connecting containers from separate Dockerfiles, it allows you to use a YAML file (called the Compose file) to define all of your application&#8217;s services, after which you can create and start them by using a single [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1055,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[45,34,44],"class_list":["post-1037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","tag-docker","tag-ubuntu","tag-ubuntu-18-04"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png",1024,512,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04-300x150.png",300,150,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04-768x384.png",768,384,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png",1024,512,false],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png",1024,512,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png",1024,512,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>Docker Compose is a tool that helps you define and run multi-container applications. Instead of you building, running and connecting containers from separate Dockerfiles, it allows you to use a YAML file (called the Compose file) to define all of your application&#8217;s services, after which you can create and start them by using a single command. Some of the most popular uses of Docker Compose include single application deployments, automated testing and local development. In this tutorial we&#8217;ll learn how to install Docker Compose by the end of it, you should have a basic understanding of some of its&#8217; commands&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/getting-started\/\" rel=\"category tag\">Getting Started<\/a>","author_info_v2":{"name":"Vlad","url":"https:\/\/draculaservers.com\/tutorials\/author\/vlad\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install &amp; Use Docker Compose on Ubuntu 18.04 - Dracula Servers<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install &amp; Use Docker Compose on Ubuntu 18.04 - Dracula Servers\" \/>\n<meta property=\"og:description\" content=\"Docker Compose is a tool that helps you define and run multi-container applications. Instead of you building, running and connecting containers from separate Dockerfiles, it allows you to use a YAML file (called the Compose file) to define all of your application&#8217;s services, after which you can create and start them by using a single [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-30T16:11:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-14T23:06:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vlad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vlad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"Vlad\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\"},\"headline\":\"How to Install &#038; Use Docker Compose on Ubuntu 18.04\",\"datePublished\":\"2018-11-30T16:11:33+00:00\",\"dateModified\":\"2021-11-14T23:06:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/\"},\"wordCount\":1042,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png\",\"keywords\":[\"Docker\",\"Ubuntu\",\"Ubuntu 18.04\"],\"articleSection\":[\"Getting Started\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/\",\"name\":\"How to Install & Use Docker Compose on Ubuntu 18.04 - Dracula Servers\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png\",\"datePublished\":\"2018-11-30T16:11:33+00:00\",\"dateModified\":\"2021-11-14T23:06:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png\",\"width\":1024,\"height\":512,\"caption\":\"install_use_docker_compose_ubuntu_18.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-use-docker-compose-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install &#038; Use Docker Compose on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\",\"name\":\"Vlad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"caption\":\"Vlad\"},\"description\":\"Tech Support\",\"sameAs\":[\"https:\\\/\\\/draculaservers.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install & Use Docker Compose on Ubuntu 18.04 - Dracula Servers","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install & Use Docker Compose on Ubuntu 18.04 - Dracula Servers","og_description":"Docker Compose is a tool that helps you define and run multi-container applications. Instead of you building, running and connecting containers from separate Dockerfiles, it allows you to use a YAML file (called the Compose file) to define all of your application&#8217;s services, after which you can create and start them by using a single [&hellip;]","og_url":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2018-11-30T16:11:33+00:00","article_modified_time":"2021-11-14T23:06:06+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png","type":"image\/png"}],"author":"Vlad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vlad","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/"},"author":{"name":"Vlad","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e"},"headline":"How to Install &#038; Use Docker Compose on Ubuntu 18.04","datePublished":"2018-11-30T16:11:33+00:00","dateModified":"2021-11-14T23:06:06+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/"},"wordCount":1042,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png","keywords":["Docker","Ubuntu","Ubuntu 18.04"],"articleSection":["Getting Started"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/","url":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/","name":"How to Install & Use Docker Compose on Ubuntu 18.04 - Dracula Servers","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png","datePublished":"2018-11-30T16:11:33+00:00","dateModified":"2021-11-14T23:06:06+00:00","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/11\/How-to-Install-Use-Docker-Compose-on-Ubuntu-18.04.png","width":1024,"height":512,"caption":"install_use_docker_compose_ubuntu_18.04"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/install-use-docker-compose-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Install &#038; Use Docker Compose on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e","name":"Vlad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","caption":"Vlad"},"description":"Tech Support","sameAs":["https:\/\/draculaservers.com"]}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1037"}],"version-history":[{"count":2,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":2237,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/1037\/revisions\/2237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/1055"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}