{"id":225,"date":"2024-05-03T14:42:25","date_gmt":"2024-05-03T11:42:25","guid":{"rendered":"https:\/\/dinodevs.com\/blog\/?p=225"},"modified":"2025-09-30T02:02:38","modified_gmt":"2025-09-29T23:02:38","slug":"running-a-docker-server-on-aws-securely","status":"publish","type":"post","link":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/","title":{"rendered":"Running a Docker Server on AWS securely"},"content":{"rendered":"\n<p>Let&#8217;s say you want to run a Docker server on the cloud. Amazon Web Services (AWS) and its Elastic Compute Cloud (EC2) is one option. It&#8217;s not the cheapest one, but it&#8217;s chosen by many.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Preparing an EC2 Instance<\/h2>\n\n\n\n<p>To start with, let&#8217;s prepare the EC2 instance that will be hosting our Docker server. Head to your AWS portal, log in and then find the EC2 Dashboard (you can do that by searching for &#8220;EC2&#8221; on the top search bar). Make sure you have selected the appropriate location (e.g. Frankfurt) from the dropdown list on the top right corner of the page, and then click the &#8220;Launch instance&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"361\" data-id=\"271\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-search-for-ec2-1024x361.png\" alt=\"\" class=\"wp-image-271\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-search-for-ec2-1024x361.png 1024w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-search-for-ec2-300x106.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-search-for-ec2-768x271.png 768w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-search-for-ec2.png 1105w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Finding EC2 dashboard using the search bar in AWS.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"455\" data-id=\"272\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-dashboard-1024x455.png\" alt=\"\" class=\"wp-image-272\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-dashboard-1024x455.png 1024w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-dashboard-300x133.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-dashboard-768x341.png 768w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-dashboard.png 1310w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The AWS EC2 Dashboard. You can launch an instance by clicking the orange &#8220;Launch instance&#8221; button.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>Let&#8217;s now configure the instance to be launched. To start with, we should give a name to the instance so that we can recognize it and select an OS image to install on the instance (we will be choosing the latest stable Ubuntu version).<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"382\" data-id=\"273\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-name.png\" alt=\"\" class=\"wp-image-273\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-name.png 866w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-name-300x132.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-name-768x339.png 768w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><figcaption class=\"wp-element-caption\">Insert a name for your EC2 instance.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"870\" height=\"778\" data-id=\"274\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-image.png\" alt=\"\" class=\"wp-image-274\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-image.png 870w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-image-300x268.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-image-768x687.png 768w\" sizes=\"auto, (max-width: 870px) 100vw, 870px\" \/><figcaption class=\"wp-element-caption\">Select the latest Ubuntu image to be installed on your EC2 instance.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>Following that, you will have to select the instance type of the EC2 instance. The instance type is defining your EC2 instance&#8217;s hardware specifications. For my purposes, we will be choosing the &#8220;M5a&#8221; instance type family, powered by AMD EPYC 7571 processors, and selecting the smallest instance size available (namely &#8220;m5a.large&#8221;, featuring 2 vCPUs and 8 GiB of Memory) for the configuration of the server (we can upgrade it easily later on). You can find more information about the various EC2 instance types <a href=\"https:\/\/aws.amazon.com\/ec2\/instance-types\/\">here<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"873\" height=\"688\" data-id=\"275\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type.png\" alt=\"\" class=\"wp-image-275\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type.png 873w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-300x236.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-768x605.png 768w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><figcaption class=\"wp-element-caption\">Selecting the EC2 instance&#8217;s type.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1256\" height=\"655\" data-id=\"276\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-info.png\" alt=\"\" class=\"wp-image-276\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-info.png 1256w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-info-300x156.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-info-1024x534.png 1024w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-type-info-768x401.png 768w\" sizes=\"auto, (max-width: 1256px) 100vw, 1256px\" \/><figcaption class=\"wp-element-caption\">Find more information about the various EC2 instance types <a href=\"https:\/\/aws.amazon.com\/ec2\/instance-types\/\">here<\/a>.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>Moving on, you will have to select a Key pair to install on the instance. This will allow you to access the server through SSH easily. If you don&#8217;t have one already created, create one and install it on your computer.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"283\" data-id=\"277\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair.png\" alt=\"\" class=\"wp-image-277\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair.png 871w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair-300x97.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair-768x250.png 768w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><figcaption class=\"wp-element-caption\">Select your key pair to be added on the EC2 instance.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"649\" data-id=\"278\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair-new.png\" alt=\"\" class=\"wp-image-278\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair-new.png 630w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-keypair-new-291x300.png 291w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><figcaption class=\"wp-element-caption\">Create a new key pair if you don&#8217;t have one.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>The next crucial step is to configure the network settings of the EC2 instance. Make sure that your instance is connected to the appropriate VPC and that the selected subnet has internet access so that you can expose the instance&#8217;s services to the public internet.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"869\" height=\"738\" data-id=\"279\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-network-settings.png\" alt=\"\" class=\"wp-image-279\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-network-settings.png 869w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-network-settings-300x255.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-network-settings-768x652.png 768w\" sizes=\"auto, (max-width: 869px) 100vw, 869px\" \/><figcaption class=\"wp-element-caption\">Configure the network settings of the EC2 instance.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>The last step of setting up our new EC2 instance is to configure its storage. For our example, I will be setting it to 200 GiB of storage, but you should be configuring that according to your needs.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"407\" data-id=\"281\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-storage-1.png\" alt=\"\" class=\"wp-image-281\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-storage-1.png 799w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-storage-1-300x153.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-storage-1-768x391.png 768w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><figcaption class=\"wp-element-caption\">Configure the storage of the EC2 instance.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>Finally&#8230; we are done! Time to launch the new EC2 instance&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" data-id=\"284\" src=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-launch-1-1024x491.png\" alt=\"\" class=\"wp-image-284\" srcset=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-launch-1-1024x491.png 1024w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-launch-1-300x144.png 300w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-launch-1-768x368.png 768w, https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/06\/aws-ec2-instance-launch-1.png 1269w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Review the configuration and click &#8220;Lacunch instance&#8221;.<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Docker<\/h2>\n\n\n\n<p>Installing Docker on an Ubuntu EC2 instance is relatively trivial, as you just have to follow the <a href=\"https:\/\/docs.docker.com\/engine\/install\/ubuntu\/#install-using-the-repository\">official guide<\/a>. Here are the commands you will need to run (based on the guide of 2023):<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>sudo apt-get update\nsudo apt-get install -y ca-certificates curl\nsudo install -m 0755 -d \/etc\/apt\/keyrings\nsudo curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg -o \/etc\/apt\/keyrings\/docker.asc\nsudo chmod a+r \/etc\/apt\/keyrings\/docker.asc\necho \\\n  \"deb &#91;arch=$(dpkg --print-architecture) signed-by=\/etc\/apt\/keyrings\/docker.asc] https:\/\/download.docker.com\/linux\/ubuntu \\\n  $(. \/etc\/os-release &amp;&amp; echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null\nsudo apt-get update\nsudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin<\/code><\/pre>\n\n\n\n<p>Now the docker server should be up and running!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Securing the Docker Server<\/h2>\n\n\n\n<p>Unfortunately, by default, the containers will be able to request and retrieve the AWS Metadata information. These may result in the leak of private keys that a malicious container can use to get access to the host server (the AWS EC2 instance running the docker containers).<\/p>\n\n\n\n<p>Fortunately, to achieve that and leak these metadata, the attacker will have to get Remote Code Execution (RCE) on the container or Server Side Request Forgery (SSRF), which may not be trivial depending on the software running on a container. Yet again, in some cases, like in CTF competitions, it is usually expected that the user will get such access to the container, thus making by default the whole server vulnerable.<\/p>\n\n\n\n<p>To fix this issue, the only thing we can do is configure the AWS Metadata to accept requests from the host machine and not from the containers inside it. To do so, we can filter the requests based on their hops, limiting the accepted hop value to 1. You can set this option on your instance by running the following command (replace <code>%your_instance_id%<\/code> with your instance ID) :<\/p>\n\n\n\n<pre class=\"wp-block-code lang-bash\"><code>aws ec2 modify-instance-metadata-options --instance-id %your_instance_id% --http-put-response-hop-limit 1<\/code><\/pre>\n\n\n\n<p>Please note that this may not work if the containers are not running in the default <code>bridge<\/code> network mode! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say you want to run a Docker server on the cloud. Amazon Web Services (AWS) and its Elastic Compute Cloud (EC2) is one option. It&#8217;s not the cheapest one, but it&#8217;s chosen by many. Preparing an EC2 Instance To start with, let&#8217;s prepare the EC2 instance that will be hosting our Docker server. Head [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":240,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[17,16,18,14],"class_list":["post-225","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-aws","tag-docker","tag-security","tag-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running a Docker Server on AWS securely - DinoDevs<\/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:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running a Docker Server on AWS securely - DinoDevs\" \/>\n<meta property=\"og:description\" content=\"Let&#8217;s say you want to run a Docker server on the cloud. Amazon Web Services (AWS) and its Elastic Compute Cloud (EC2) is one option. It&#8217;s not the cheapest one, but it&#8217;s chosen by many. Preparing an EC2 Instance To start with, let&#8217;s prepare the EC2 instance that will be hosting our Docker server. Head [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\" \/>\n<meta property=\"og:site_name\" content=\"DinoDevs\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-03T11:42:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-29T23:02:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"346\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Athanasios Grammatopoulos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Athanasios Grammatopoulos\" \/>\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:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\"},\"author\":{\"name\":\"Athanasios Grammatopoulos\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/fccac7bcc5374cede43de49a450dfaf3\"},\"headline\":\"Running a Docker Server on AWS securely\",\"datePublished\":\"2024-05-03T11:42:25+00:00\",\"dateModified\":\"2025-09-29T23:02:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\"},\"wordCount\":739,\"publisher\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png\",\"keywords\":[\"aws\",\"docker\",\"security\",\"server\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\",\"url\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\",\"name\":\"Running a Docker Server on AWS securely - DinoDevs\",\"isPartOf\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png\",\"datePublished\":\"2024-05-03T11:42:25+00:00\",\"dateModified\":\"2025-09-29T23:02:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage\",\"url\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png\",\"contentUrl\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png\",\"width\":1024,\"height\":346},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dinodevs.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Running a Docker Server on AWS securely\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#website\",\"url\":\"https:\/\/dinodevs.com\/blog\/\",\"name\":\"DinoDevs\",\"description\":\"When in doubt, code it out.\",\"publisher\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dinodevs.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#organization\",\"name\":\"DinoDevs\",\"url\":\"https:\/\/dinodevs.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2025\/05\/dinodevs.cube_.png\",\"contentUrl\":\"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2025\/05\/dinodevs.cube_.png\",\"width\":600,\"height\":600,\"caption\":\"DinoDevs\"},\"image\":{\"@id\":\"https:\/\/dinodevs.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/fccac7bcc5374cede43de49a450dfaf3\",\"name\":\"Athanasios Grammatopoulos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0271fabc59edad96ed659fb1a3c4caf867a7324609e22d0b2cc25ad71d4c0d8c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0271fabc59edad96ed659fb1a3c4caf867a7324609e22d0b2cc25ad71d4c0d8c?s=96&d=mm&r=g\",\"caption\":\"Athanasios Grammatopoulos\"},\"sameAs\":[\"https:\/\/github.com\/GramThanos\"],\"url\":\"https:\/\/dinodevs.com\/blog\/author\/gramthanos\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Running a Docker Server on AWS securely - DinoDevs","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:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/","og_locale":"en_US","og_type":"article","og_title":"Running a Docker Server on AWS securely - DinoDevs","og_description":"Let&#8217;s say you want to run a Docker server on the cloud. Amazon Web Services (AWS) and its Elastic Compute Cloud (EC2) is one option. It&#8217;s not the cheapest one, but it&#8217;s chosen by many. Preparing an EC2 Instance To start with, let&#8217;s prepare the EC2 instance that will be hosting our Docker server. Head [&hellip;]","og_url":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/","og_site_name":"DinoDevs","article_published_time":"2024-05-03T11:42:25+00:00","article_modified_time":"2025-09-29T23:02:38+00:00","og_image":[{"width":1024,"height":346,"url":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png","type":"image\/png"}],"author":"Athanasios Grammatopoulos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Athanasios Grammatopoulos","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#article","isPartOf":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/"},"author":{"name":"Athanasios Grammatopoulos","@id":"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/fccac7bcc5374cede43de49a450dfaf3"},"headline":"Running a Docker Server on AWS securely","datePublished":"2024-05-03T11:42:25+00:00","dateModified":"2025-09-29T23:02:38+00:00","mainEntityOfPage":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/"},"wordCount":739,"publisher":{"@id":"https:\/\/dinodevs.com\/blog\/#organization"},"image":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage"},"thumbnailUrl":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png","keywords":["aws","docker","security","server"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/","url":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/","name":"Running a Docker Server on AWS securely - DinoDevs","isPartOf":{"@id":"https:\/\/dinodevs.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage"},"image":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage"},"thumbnailUrl":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png","datePublished":"2024-05-03T11:42:25+00:00","dateModified":"2025-09-29T23:02:38+00:00","breadcrumb":{"@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#primaryimage","url":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png","contentUrl":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2024\/05\/docker-on-aws-security.png","width":1024,"height":346},{"@type":"BreadcrumbList","@id":"https:\/\/dinodevs.com\/blog\/running-a-docker-server-on-aws-securely\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dinodevs.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Running a Docker Server on AWS securely"}]},{"@type":"WebSite","@id":"https:\/\/dinodevs.com\/blog\/#website","url":"https:\/\/dinodevs.com\/blog\/","name":"DinoDevs","description":"When in doubt, code it out.","publisher":{"@id":"https:\/\/dinodevs.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dinodevs.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dinodevs.com\/blog\/#organization","name":"DinoDevs","url":"https:\/\/dinodevs.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dinodevs.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2025\/05\/dinodevs.cube_.png","contentUrl":"https:\/\/dinodevs.com\/blog\/wp-content\/uploads\/2025\/05\/dinodevs.cube_.png","width":600,"height":600,"caption":"DinoDevs"},"image":{"@id":"https:\/\/dinodevs.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/fccac7bcc5374cede43de49a450dfaf3","name":"Athanasios Grammatopoulos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dinodevs.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0271fabc59edad96ed659fb1a3c4caf867a7324609e22d0b2cc25ad71d4c0d8c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0271fabc59edad96ed659fb1a3c4caf867a7324609e22d0b2cc25ad71d4c0d8c?s=96&d=mm&r=g","caption":"Athanasios Grammatopoulos"},"sameAs":["https:\/\/github.com\/GramThanos"],"url":"https:\/\/dinodevs.com\/blog\/author\/gramthanos\/"}]}},"_links":{"self":[{"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":10,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions\/287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dinodevs.com\/blog\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}