What is the difference between ports and expose in docker-compose? - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (/opensearch.xml) (https://stackoverflow.com/questions/40801772/what-is-the-difference-between-ports-and-expose-in-docker-compose) (https://cdn.sstatic.net/Shared/stacks.css?v=bd2aba62c5a4) (https://cdn.sstatic.net/Sites/stackoverflow/primary.css?v=7d8876444382) (Feed for question 'What is the difference between ports and expose in docker-compose?') (/feeds/question/40801772) (https://cdn.sstatic.net/Shared/Channels/channels.css?v=5981bb1a5bd7) (https://accounts.google.com/gsi/style) (site logo) Join Stack Overflow By clicking “Sign up”, you agree to our (/legal/terms-of-service/public) terms of service and acknowledge you have read our (/legal/privacy-policy) privacy policy . (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) (1) (2.0) Sign up with Google Sign up with GitHub OR (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) (1) () () () () () () Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (/users/login) Log in (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) () Skip to main content (https://stackoverflow.com) Stack Overflow (https://stackoverflow.co/) About Products (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai) OverflowAI (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams) Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising) Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai) OverflowAI GenAI features for Teams (https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api) OverflowAPI Train & fine-tune LLMs (https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs) Labs The future of collective knowledge sharing (https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) About the company (https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog) Visit the blog (Search…) () Loading… (https://stackoverflow.com) current community (https://stackoverflow.com) (Stack Overflow) Stack Overflow (https://stackoverflow.com/help) help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) chat (https://meta.stackoverflow.com) (Meta Stack Overflow) Meta Stack Overflow your communities (https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f40801772%2fwhat-is-the-difference-between-ports-and-expose-in-docker-compose) Sign up or (https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f40801772%2fwhat-is-the-difference-between-ports-and-expose-in-docker-compose) log in to customize your list. (https://stackexchange.com/sites) more stack exchange communities (https://stackoverflow.blog) company blog (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f40801772%2fwhat-is-the-difference-between-ports-and-expose-in-docker-compose) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f40801772%2fwhat-is-the-difference-between-ports-and-expose-in-docker-compose) Sign up Let's set up your homepage Select a few topics you're interested in: python javascript c# reactjs java android html flutter c++ node.js typescript css r php angular next.js spring-boot machine-learning sql excel ios azure docker Or search from our full list: (Search) javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json python-3.x .net ruby-on-rails sql-server swift django angular objective-c excel pandas angularjs regex typescript ruby linux ajax iphone vba xml laravel spring asp.net-mvc database wordpress string flutter postgresql mongodb wpf windows amazon-web-services xcode bash git oracle-database spring-boot dataframe azure firebase list multithreading docker vb.net react-native eclipse algorithm powershell macos visual-studio numpy image forms scala function vue.js performance twitter-bootstrap selenium winforms kotlin loops express dart hibernate sqlite matlab python-2.7 shell rest apache entity-framework android-studio csv maven api linq qt dictionary unit-testing facebook asp.net-core tensorflow apache-spark file swing class unity-game-engine sorting date authentication go symfony t-sql opencv matplotlib .htaccess google-chrome for-loop datetime codeigniter http perl validation sockets google-maps object uitableview xaml oop if-statement visual-studio-code cordova ubuntu web-services email android-layout github elasticsearch spring-mvc kubernetes selenium-webdriver ms-access user-interface parsing ggplot2 pointers machine-learning google-sheets c++11 security flask google-apps-script ruby-on-rails-3 templates nginx variables exception sql-server-2008 gradle debugging tkinter listview delphi jpa asynchronous pdf web-scraping haskell jsp ssl amazon-s3 google-cloud-platform jenkins testing xamarin wcf npm batch-file generics ionic-framework network-programming unix recursion google-app-engine mongoose visual-studio-2010 .net-core android-fragments assembly animation math next.js session svg hadoop intellij-idea curl django-models join laravel-5 rust winapi url heroku http-redirect tomcat google-cloud-firestore inheritance webpack keras image-processing gcc asp.net-mvc-4 web logging dom swiftui matrix pyspark actionscript-3 button post optimization firebase-realtime-database jquery-ui iis cocoa xpath d3.js javafx firefox internet-explorer xslt caching select asp.net-mvc-3 opengl events asp.net-web-api plot dplyr magento encryption search stored-procedures amazon-ec2 ruby-on-rails-4 memory canvas audio multidimensional-array jsf random vector cookies redux facebook-graph-api input flash xamarin.forms indexing arraylist ipad cocoa-touch data-structures video apache-kafka model-view-controller serialization jdbc woocommerce routes razor azure-devops awk servlets mod-rewrite beautifulsoup docker-compose excel-formula iframe filter aws-lambda design-patterns text django-rest-framework visual-c++ cakephp mobile android-intent react-hooks struct methods groovy mvvm ssh lambda checkbox ecmascript-6 google-chrome-extension time grails installation sharepoint cmake shiny spring-security jakarta-ee android-recyclerview plsql core-data types meteor android-activity sed bootstrap-4 websocket activerecord graph replace scikit-learn file-upload group-by vim junit boost deep-learning import sass memory-management error-handling async-await dynamic eloquent soap silverlight dependency-injection charts layout apache-spark-sql deployment browser gridview svn while-loop google-bigquery vuejs2 ffmpeg dll highcharts view foreach plugins makefile c#-4.0 redis reporting-services jupyter-notebook merge server unicode https reflection google-maps-api-3 twitter oauth-2.0 extjs pytorch axios terminal pip split mysqli cmd django-views encoding database-design automation collections netbeans hash build data-binding ember.js tcp sqlalchemy pdo apache-flex concurrency entity-framework-core command-line spring-data-jpa printing java-8 react-redux jestjs service html-table neo4j lua ansible parameters module material-ui enums visual-studio-2012 promise flexbox outlook webview firebase-authentication web-applications uwp jquery-mobile utf-8 datatable python-requests parallel-processing drop-down-menu colors scroll hive tfs scipy count syntax ms-word twitter-bootstrap-3 ssis google-analytics fonts three.js constructor powerbi rxjs graphql file-io paypal discord cassandra socket.io graphics compiler-errors gwt react-router nlp solr url-rewriting backbone.js memory-leaks datatables oauth datagridview terraform drupal oracle11g zend-framework neural-network knockout.js triggers django-forms interface google-api angular-material casting jmeter linked-list path proxy timer django-templates arduino orm directory visual-studio-2015 parse-platform windows-phone-7 cron push-notification conditional-statements primefaces functional-programming pagination model jar xamarin.android hyperlink uiview visual-studio-2013 gitlab vbscript google-cloud-functions azure-active-directory jwt download swift3 sql-server-2005 configuration process rspec pygame properties combobox callback windows-phone-8 linux-kernel safari permissions scrapy raspberry-pi scripting emacs clojure x86 scope io compilation mongodb-query nhibernate responsive-design angularjs-directive expo request azure-functions bluetooth 3d dns binding reference discord.js architecture playframework version-control pyqt doctrine-orm package pycharm get sql-server-2012 rubygems f# autocomplete datepicker openssl kendo-ui tree jackson controller yii grep nested xamarin.ios static dockerfile statistics transactions datagrid null active-directory uiviewcontroller phpmyadmin webforms discord.py notifications sas computer-vision duplicates mocking youtube nullpointerexception yaml menu sum bitmap electron asp.net-mvc-5 visual-studio-2008 time-series blazor yii2 jsf-2 css-selectors stl android-listview floating-point cryptography ant stream hashmap character-encoding msbuild sdk asp.net-core-mvc google-drive-api selenium-chromedriver jboss joomla navigation cors devise anaconda background camera multiprocessing pyqt5 binary frontend cuda linq-to-sql iterator mariadb onclick plotly ios7 rabbitmq android-jetpack-compose android-asynctask microsoft-graph-api tabs laravel-4 insert uicollectionview environment-variables amazon-dynamodb linker console xsd coldfusion upload continuous-integration ftp textview opengl-es operating-system vuejs3 mockito localization xml-parsing macros formatting json.net kivy type-conversion data.table timestamp calendar integer segmentation-fault android-ndk drag-and-drop prolog char crash jasmine automated-tests dependencies geometry android-gradle-plugin itext firebase-cloud-messaging header fortran sprite-kit mfc attributes nuxt.js nosql format azure-pipelines nestjs odoo jquery-plugins db2 jenkins-pipeline leaflet event-handling postman flutter-layout julia annotations keyboard textbox arm visual-studio-2017 gulp libgdx stripe-payments xampp synchronization crystal-reports timezone dom-events azure-web-app-service android-emulator uikit swagger wso2 sequelize.js namespaces aggregation-framework uiscrollview jvm google-sheets-formula chart.js com subprocess geolocation webdriver centos html5-canvas widget dialog garbage-collection snowflake-cloud-data-platform numbers concatenation sql-update qml set windows-10 mapreduce tuples smtp ionic2 java-stream rotation modal-dialog spring-data android-edittext http-headers doctrine radio-button nuget grid sonarqube lucene xmlhttprequest internationalization listbox components initialization switch-statement google-play apache-camel boolean serial-port ldap ios5 youtube-api return gdb pivot eclipse-plugin latex frameworks tags containers github-actions dataset asp-classic subquery foreign-keys label copy uinavigationcontroller c++17 delegates google-cloud-storage struts2 migration base64 protractor find sql-server-2008-r2 queue uibutton embedded arguments composer-php append jaxb zip stack cucumber autolayout ide entity-framework-6 popup iteration airflow windows-7 r-markdown ssl-certificate vb6 tailwind-css gmail hover jqgrid g++ udp Next You’ll be prompted to create an account to view your personalized homepage. (/) Home (/questions) Questions (/tags) Tags (/users) Users (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Labs (/jobs?source=so-left-nav) Jobs (/beta/discussions) Discussions Collectives Communities for your favorite technologies. (/collectives-all) Explore all Collectives Teams () Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Try Teams for free (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact) Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. (/collectives) Learn more about Collectives Teams Q&A for work Connect and share knowledge within a single location that is structured and easy to search. (https://stackoverflow.co/teams/) Learn more about Teams Get early access and see previews of new features. (https://stackoverflow.co/labs/) Learn more about Labs (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (/questions/40801772/what-is-the-difference-between-ports-and-expose-in-docker-compose) What is the difference between ports and expose in docker-compose? (/questions/ask) Ask Question (2016-11-25 09:39:10Z) Asked 8 years, 3 months ago Modified (?lastactivity) (2024-04-19 23:06:45Z) 11 months ago (Viewed 730,333 times) Viewed 730k times This question shows research effort; it is useful and clear (70:3:31e,16:4d5b400885ff02bc,10:1742105675,16:1aba209bb0ce016a,8:40801772,560b555da65baddf108821325ffc21f73a59a5a4fcd44b13dc19382d9debc54a) 1017 (This question does not show any research effort; it is unclear or not useful) (70:3:31e,16:b55fafe629db8bad,10:1742105675,16:840430953d55a993,8:40801772,ebd35bddf53345c1559d7e86d125dc2eea0f9693a8bf63319ccec5c2df009ad6) Save this question. (/posts/40801772/timeline) Show activity on this post. What is the difference between ports and expose options in docker-compose.yml ? (/questions/tagged/docker) (show questions tagged 'docker') docker (/questions/tagged/docker-compose) (show questions tagged 'docker-compose') docker-compose (/q/40801772) (Short permalink to this question) Share Share a link to this question Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/40801772/edit) () Improve this question Follow (70:3:31e,16:6bb87eda2b3e393c,10:1742105675,16:7c8fb2f7174b1d08,8:40801772,99b9b96d99e13d6b3bb2d6ddf4311c7e6e8d6a958ee909c3424b21352cfedd13) Follow this question to receive notifications (/posts/40801772/revisions) (show all edits to this post) edited (2022-10-21 11:26:46Z) Oct 21, 2022 at 11:26 (/users/8747928/luis-lavaire) (Luis Lavaire's user avatar) (/users/8747928/luis-lavaire) Luis Lavaire (reputation score) 701 (7 silver badges) 7 7 silver badges (18 bronze badges) 18 18 bronze badges asked (2016-11-25 09:39:10Z) Nov 25, 2016 at 9:39 (/users/84143/bibek-shrestha) (Bibek Shrestha's user avatar) (/users/84143/bibek-shrestha) Bibek Shrestha Bibek Shrestha (reputation score 35,054) 35.1k (7 gold badges) 7 7 gold badges (34 silver badges) 34 34 silver badges (35 bronze badges) 35 35 bronze badges 1 (number of 'useful comment' votes received) 1 (https://www.baeldung.com/ops/docker-compose-expose-vs-ports) baeldung.com/ops/docker-compose-expose-vs-ports – (/users/298511/mike-lowery) (2,868 reputation) Mike Lowery Commented (2023-05-06 18:23:21Z, License: CC BY-SA 4.0) May 6, 2023 at 18:23 (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) Add a comment | (Expand to show all comments on this post) 5 Answers 5 Sorted by: (/questions/40801772/what-is-the-difference-between-ports-and-expose-in-docker-compose?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (trending) Trending (recent votes count more) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) This answer is useful (70:3:31e,16:c1d623684e03f38d,10:1742105675,16:f99a8a7457cb4338,8:40801773,110c70d64565f082f2873ee8112b5c6905dff4a853045f88bd97c06b078df3dd) 1016 (This answer is not useful) (70:3:31e,16:a1f9d64a2c7f25ce,10:1742105675,16:afd34f4b235a9897,8:40801773,b5383f13c75c559109a19dfe3dff6879dc10f506f11158b1977344b25d06b114) Save this answer. (Loading when this answer was accepted…) (/posts/40801773/timeline) Show activity on this post. According to the (https://docs.docker.com/compose/compose-file/) docker-compose reference , (https://docs.docker.com/compose/compose-file/compose-file-v3/#ports) Ports is defined as: Expose ports . Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen). Ports mentioned in docker-compose.yml will be shared among different services started by the docker-compose. Ports will be exposed to the host machine to a random port or a given port. My docker-compose.yml looks like: mysql: image: mysql:5.7 ports: - "3306" If I do docker-compose ps , it will look like: Name Command State Ports ------------------------------------------------------------------------------------- mysql_1 docker-entrypoint.sh mysqld Up 0.0 .0 .0 :32769->3306/tcp (https://docs.docker.com/compose/compose-file/compose-file-v3/#expose) Expose is defined as: Expose ports without publishing them to the host machine - they’ll only be accessible to linked services. Only the internal port can be specified. Ports are not exposed to host machines, only exposed to other services. mysql: image: mysql:5.7 expose: - "3306" If I do docker-compose ps , it will look like: Name Command State Ports --------------------------------------------------------------- mysql_1 docker-entrypoint.sh mysqld Up 3306 /tcp Edit In recent versions of Dockerfile, EXPOSE (https://docs.docker.com/engine/reference/builder/#expose) typically doesn't have any operational impact anymore, it is just informative. ((https://stackoverflow.com/a/65785558/5075502) see also ) (/a/40801773) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/40801773/edit) () Improve this answer Follow (70:3:31e,16:a59ecd1fbbccecf4,10:1742105675,16:8291e53e625c039f,8:40801773,00c4dd8707fa6381944908e5d7daca9108b72dd9b83c31be141270f8d0713ad4) Follow this answer to receive notifications (/posts/40801773/revisions) (show all edits to this post) edited (2024-02-14 05:15:00Z) Feb 14, 2024 at 5:15 (/users/32453/rogerdpack) (rogerdpack's user avatar) (/users/32453/rogerdpack) rogerdpack (reputation score 66,961) 67k (40 gold badges) 40 40 gold badges (284 silver badges) 284 284 silver badges (404 bronze badges) 404 404 bronze badges answered (2016-11-25 09:39:10Z) Nov 25, 2016 at 9:39 (/users/84143/bibek-shrestha) (Bibek Shrestha's user avatar) (/users/84143/bibek-shrestha) Bibek Shrestha Bibek Shrestha (reputation score 35,054) 35.1k (7 gold badges) 7 7 gold badges (34 silver badges) 34 34 silver badges (35 bronze badges) 35 35 bronze badges 10 (number of 'useful comment' votes received) 72 would it be possible eto explain what advantages there are to specifying expose in a docker-compose ? As far as I can tell, you don't need to specify expose to make ports accessible to linked services. – (/users/2018084/juicy) (12,530 reputation) Juicy Commented (2018-05-06 11:23:15Z, License: CC BY-SA 4.0) May 6, 2018 at 11:23 (number of 'useful comment' votes received) 6 Shouldn't it tell that exposed ports will only be available to services in the same docker network (linking is being replaced for most parts)?. – (/users/6313007/meow) (2,201 reputation) meow Commented (2018-08-26 11:28:23Z, License: CC BY-SA 4.0) Aug 26, 2018 at 11:28 (this comment was edited 1 time) (number of 'useful comment' votes received) 21 @Juicy I guess it's similar to expose in Dockerfiles: "The EXPOSE instruction does not actually publish the port. It functions as a type of documentation..." (https://docs.docker.com/engine/reference/builder/#expose) docs.docker.com/engine/reference/builder/#expose – (/users/119937/tsauerwein) (6,051 reputation) tsauerwein Commented (2018-09-06 11:47:54Z, License: CC BY-SA 4.0) Sep 6, 2018 at 11:47 (number of 'useful comment' votes received) 3 Do Ports override any settings at the firewall level? I just noticed that I didn't open up ports for mysql on the firewall, but they were accessible remotely. I had Ports set to "3306:3306" instead of expose. – (/users/503246/techfandan) (3,502 reputation) TechFanDan Commented (2019-05-28 23:06:26Z, License: CC BY-SA 4.0) May 28, 2019 at 23:06 (number of 'useful comment' votes received) 6 And remember, if you use docker-compose run , the port definition in docker-compose.yml is ignored by default. Either use docker-compose up or provide the parameter --service-ports – (/users/1488445/juha-untinen) (1,887 reputation) Juha Untinen Commented (2019-10-27 13:44:57Z, License: CC BY-SA 4.0) Oct 27, 2019 at 13:44 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) | (Expand to show all comments on this post) Show 5 more comments This answer is useful (70:3:31e,16:6313e733f1133d7f,10:1742105675,16:878ca080025b23bf,8:54883938,aed100e474c27389a829de9c86095be07d714a16d0ec49299b314ace3f6bbd66) 471 (This answer is not useful) (70:3:31e,16:966d513593c8a8db,10:1742105675,16:b265261c7d4f51d0,8:54883938,9c04ef6c26bb9cb848751537a5357294022b07bbf4de38e7e93375679be67e8b) Save this answer. (Loading when this answer was accepted…) (/posts/54883938/timeline) Show activity on this post. ports : Activates the container to listen for specified port(s) from the world outside of the docker (can be the same host machine or a different machine) AND is also accessible to the world inside Docker. More than one port can be specified (that's why it's ports not port). (https://i.sstatic.net/Nb6Om.png) (illustration of "ports") expose : Activates container to listen for a specific port only from the world inside of docker AND is not accessible to the world outside of Docker. More than one port can be specified. (https://i.sstatic.net/s4k6E.png) (illustration of "expose") (/a/54883938) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/54883938/edit) () Improve this answer Follow (70:3:31e,16:d7b326ded5a5ba4a,10:1742105675,16:a1f0bee63ab812f2,8:54883938,8aaff1a18d8e290f27274a5c829ef8ee63bc4c205141544faa974a5d596c86f2) Follow this answer to receive notifications (/posts/54883938/revisions) (show all edits to this post) edited (2024-04-19 23:06:45Z) Apr 19, 2024 at 23:06 (/users/775954/matthias-braun) (Matthias Braun's user avatar) (/users/775954/matthias-braun) Matthias Braun (reputation score 34,433) 34.4k (27 gold badges) 27 27 gold badges (153 silver badges) 153 153 silver badges (176 bronze badges) 176 176 bronze badges answered (2019-02-26 10:58:25Z) Feb 26, 2019 at 10:58 (/users/4516110/mehraj-malik) (Mehraj Malik's user avatar) (/users/4516110/mehraj-malik) Mehraj Malik Mehraj Malik (reputation score 15,874) 15.9k (18 gold badges) 18 18 gold badges (61 silver badges) 61 61 silver badges (88 bronze badges) 88 88 bronze badges 6 (number of 'useful comment' votes received) 8 Note that expose allows multiple ports - (https://docs.docker.com/compose/compose-file/#expose) docs.docker.com/compose/compose-file/#expose - however you only supply the internal port rather than internal + external – (/users/1990221/stuart-moore) (801 reputation) Stuart Moore Commented (2019-04-24 14:02:57Z, License: CC BY-SA 4.0) Apr 24, 2019 at 14:02 (number of 'useful comment' votes received) 1 That's very important part: 'Activates container to listen for a specific port only from the world inside' – (/users/6725736/reven) (776 reputation) Reven Commented (2020-07-24 10:53:50Z, License: CC BY-SA 4.0) Jul 24, 2020 at 10:53 actually, all these days I understood this concept in reverse order thank you!! – (/users/10053166/aditya) (466 reputation) Aditya Commented (2023-07-13 19:40:05Z, License: CC BY-SA 4.0) Jul 13, 2023 at 19:40 (number of 'useful comment' votes received) 1 larsks claims this is incorrect (https://stackoverflow.com/a/65785558/3755989) stackoverflow.com/a/65785558/3755989 – (/users/3755989/johan) (226 reputation) Johan Commented (2024-01-11 08:58:20Z, License: CC BY-SA 4.0) Jan 11, 2024 at 8:58 When you say world inside docker , does it include all containers running on the same host (EC2 instance), even those containers outside the specific docker-compose file? – (/users/2604247/della) (1,636 reputation) Della Commented (2024-07-08 08:00:25Z, License: CC BY-SA 4.0) Jul 8, 2024 at 8:00 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) | (Expand to show all comments on this post) Show 1 more comment This answer is useful (70:3:31e,16:51c241df49163bde,10:1742105675,16:c38d025d65ee9dbc,8:52681569,ba2536ad5cd36a77233786f5852dc080bb7654be59770e90cfab43f6fb75337b) 99 (This answer is not useful) (70:3:31e,16:c26cf73779c9b92f,10:1742105675,16:4ff697d1795352aa,8:52681569,487bd99eb24dcade89ac28e631b1086c5bd8095149b74eaa2f73ee85632cb732) Save this answer. (Loading when this answer was accepted…) (/posts/52681569/timeline) Show activity on this post. Ports This section is used to define the mapping between the host server and Docker container. ports: - 10005 :80 It means the application running inside the container is exposed at port 80. But external system/entity cannot access it, so it need to be mapped to host server port. Note: you have to open the host port 10005 and modify firewall rules to allow external entities to access the application. They can use http://{host IP}:10005 something like this EXPOSE This is exclusively used to define the port on which application is running inside the docker container. You can define it in dockerfile as well. Generally, it is good and widely used practice to define EXPOSE inside dockerfile because very rarely anyone run them on other port than default 80 port (/a/52681569) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/52681569/edit) () Improve this answer Follow (70:3:31e,16:4d1bd1ef0ffa4174,10:1742105675,16:fdb779e3f7d328ff,8:52681569,78d3f5cf419e3ebc99169fef5c6e4b504b32216606d6b5d9acd21f5dc5dd02ec) Follow this answer to receive notifications (/posts/52681569/revisions) (show all edits to this post) edited (2018-10-06 18:42:56Z) Oct 6, 2018 at 18:42 answered (2018-10-06 17:24:24Z) Oct 6, 2018 at 17:24 (/users/9941105/sorabzone) (sorabzone's user avatar) (/users/9941105/sorabzone) sorabzone sorabzone (reputation score) 1,037 (7 silver badges) 7 7 silver badges (8 bronze badges) 8 8 bronze badges 0 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:439fb5ecc902feec,10:1742105675,16:1737421d21c770ed,8:56826180,233c622ef8e16279f2272e90ab0fd35ec9486191267b97d0478c73507b371d07) 80 (This answer is not useful) (70:3:31e,16:3284dfdddbfa4963,10:1742105675,16:532441017facaf26,8:56826180,72d18a77fad9f23f2181ac1f8ff4b95afa1b981b67be3e6584ba876099f995d6) Save this answer. (Loading when this answer was accepted…) (/posts/56826180/timeline) Show activity on this post. Ports The ports section will publish ports on the host. Docker will set up a forward for a specific port from the host network into the container. By default, this is implemented with a userspace proxy process (docker-proxy ) that listens on the first port, and forwards into the container, which needs to listen on the second point. If the container is not listening on the destination port, you will still see something listening on the host, but get a connection refused if you try to connect to that host port, from the failed forward into your container. Note, the container must be listening on all network interfaces since this proxy is not running within the container's network namespace and cannot reach 127.0.0.1 inside the container. The IPv4 method for that is to configure your application to listen on 0.0.0.0 . Also note that published ports do not work in the opposite direction. You cannot connect to a service on the host from the container by publishing a port. Instead you'll find docker errors trying to listen to the already-in-use host port. Expose Expose is documentation. It sets metadata on the image, and when running, on the container too. Typically, you configure this in the Dockerfile with the EXPOSE instruction, and it serves as documentation for the users running your image, for them to know on which ports by default your application will be listening. When configured with a compose file, this metadata is only set on the container. You can see the exposed ports when you run a docker inspect on the image or container. There are a few tools that rely on exposed ports. In docker, the -P flag will publish all exposed ports onto ephemeral ports on the host. There are also various reverse proxies that will default to using an exposed port when sending traffic to your application if you do not explicitly set the container port. Other than those external tools, expose has no impact at all on the networking between containers. You only need a common docker network, and connecting to the container port, to access one container from another. If that network is user created (e.g. not the default bridge network named bridge ), you can use DNS to connect to the other containers. (/a/56826180) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/56826180/edit) () Improve this answer Follow (70:3:31e,16:e4ae3550653ecdf9,10:1742105675,16:346579d81ff8ae85,8:56826180,b742ee866cde99668e5a69fbbc77c6809e6094c6571f52924e867e39cac5567a) Follow this answer to receive notifications (/posts/56826180/revisions) (show all edits to this post) edited (2022-10-06 04:48:58Z) Oct 6, 2022 at 4:48 (/users/1402846/pang) (Pang's user avatar) (/users/1402846/pang) Pang (reputation score 10,127) 10.1k (146 gold badges) 146 146 gold badges (86 silver badges) 86 86 silver badges (124 bronze badges) 124 124 bronze badges answered (2019-06-30 15:50:28Z) Jun 30, 2019 at 15:50 (/users/596285/bmitch) (BMitch's user avatar) (/users/596285/bmitch) BMitch BMitch (reputation score 265,278) 265k (50 gold badges) 50 50 gold badges (542 silver badges) 542 542 silver badges (499 bronze badges) 499 499 bronze badges 0 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:12c1fe6894bcac52,10:1742105675,16:7a4b7b91c216a1ff,8:54665221,3e9863ce0453c39d3d1f4c9c04be16a5fa2beaae06d0b31e5fb83cf940e354a3) 12 (This answer is not useful) (70:3:31e,16:4e7e2b95938a219a,10:1742105675,16:4417647eb460bed1,8:54665221,2a2883f99bf79aef63eeb6a7d649a18f2c2fad4e32448ea2da813ee9efa77e03) Save this answer. (Loading when this answer was accepted…) (/posts/54665221/timeline) Show activity on this post. I totally agree with the answers before. I just like to mention that the difference between expose and ports is part of the security concept in docker. It goes hand in hand with the (https://docs.docker.com/network/) networking of docker. For example: Imagine an application with a web front-end and a database back-end. The outside world needs access to the web front-end (perhaps on port 80), but only the back-end itself needs access to the database host and port. Using a user-defined bridge, only the web port needs to be opened, and the database application doesn’t need any ports open, since the web front-end can reach it over the user-defined bridge. This is a common use case when setting up a network architecture in docker. So for example in a default bridge network, not ports are accessible from the outer world. Therefor you can open an ingresspoint with "ports". With using "expose" you define communication within the network. If you want to expose the default ports you don't need to define "expose" in your docker-compose file. (/a/54665221) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/54665221/edit) () Improve this answer Follow (70:3:31e,16:c078a63560489344,10:1742105675,16:44193533cbbf4bf1,8:54665221,3f329f93fe4f1beb2056ee49bfb194cfc2f0cf5a3796e5f235a49988682af8ae) Follow this answer to receive notifications answered (2019-02-13 08:04:31Z) Feb 13, 2019 at 8:04 (/users/9326543/fishingislife) (FishingIsLife's user avatar) (/users/9326543/fishingislife) FishingIsLife FishingIsLife (reputation score) 2,372 (4 gold badges) 4 4 gold badges (37 silver badges) 37 37 silver badges (64 bronze badges) 64 64 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) (40801772) (false) () Your Answer (True) Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question . Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our (/help/how-to-answer) tips on writing great answers . Draft saved Draft discarded (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) Sign up or (/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f40801772%2fwhat-is-the-difference-between-ports-and-expose-in-docker-compose%23new-answer) log in Sign up using Google Sign up using Email and Password (false) (false) Submit Post as a guest Name () () Email Required, but never shown () () Post as a guest Name () () Email Required, but never shown () () Post Your Answer Discard By clicking “Post Your Answer”, you agree to our (https://stackoverflow.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://stackoverflow.com/legal/privacy-policy) privacy policy .(1) Start asking to get answers Find the answer to your question by asking. (/questions/ask) Ask question Explore related questions (/questions/tagged/docker) (show questions tagged 'docker') docker (/questions/tagged/docker-compose) (show questions tagged 'docker-compose') docker-compose See similar questions with these tags. The Overflow Blog (https://stackoverflow.blog/2025/03/14/can-climate-tech-startups-address-the-current-crisis/?cb=1) Can climate tech startups address the current crisis? (https://stackoverflow.blog/2025/03/14/what-we-learned-at-tdx-2025/?cb=1) What we learned at TDX 2025 Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025?cb=1) Community Asks Sprint Announcement - March 2025 (Meta Stack Exchange) (https://meta.stackexchange.com/questions/407425/meta-stack-exchange-site-maintenance-scheduled-starting-monday-march-17-2025-f?cb=1) (Meta Stack Exchange site maintenance scheduled starting Monday, March 17, 2025 from 13:30 UTC to 14:30 UTC (9:30am to 10:30am ET)) Meta Stack Exchange site maintenance scheduled starting Monday, March 17,... (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak?cb=1) (Is it better to redirect users who attempt to perform actions they can't yet take?) Is it better to redirect users who attempt to perform actions they can't yet... (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing?cb=1) Stacks Editor development and testing (https://chat.stackoverflow.com/) (6 users active in 11 rooms the last 60 minutes) 6 people chatting Linked (https://stackoverflow.com/q/59183027?lq=1) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/59183027/docker-compose-does-expose-function-on-the-host-port-or-the-container-port?noredirect=1&lq=1) docker-compose: does EXPOSE function on the host port or the container port? (https://stackoverflow.com/q/58240357?lq=1) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/58240357/docker-expose-wrong-ports-open?noredirect=1&lq=1) docker expose wrong ports open (https://stackoverflow.com/q/60061703?lq=1) (Question score (upvotes - downvotes)) 62 (https://stackoverflow.com/questions/60061703/when-i-specify-ports-in-a-docker-compose-yml-file-is-it-tcp-or-udp?noredirect=1&lq=1) When I specify ports in a docker-compose.yml file, is it TCP or UDP? (https://stackoverflow.com/q/65784039?lq=1) (Question score (upvotes - downvotes)) 11 (https://stackoverflow.com/questions/65784039/why-a-service-configured-with-only-expose-is-able-to-communicate-with-internet?noredirect=1&lq=1) Why a service configured with only `expose` is able to communicate with internet? (https://stackoverflow.com/q/70414483?lq=1) (Question score (upvotes - downvotes)) 7 (https://stackoverflow.com/questions/70414483/traefik-with-multiple-docker-compose-yml-files?noredirect=1&lq=1) Traefik with multiple docker-compose.yml files (https://stackoverflow.com/q/58636607?lq=1) (Question score (upvotes - downvotes)) 4 (https://stackoverflow.com/questions/58636607/how-to-read-understand-a-docker-compose-yml-and-what-the-stdin-open-true-tty?noredirect=1&lq=1) How to read / understand a docker-compose.yml and what the "stdin_open: true tty: true" components do? (https://stackoverflow.com/q/64704889?lq=1) (Question score (upvotes - downvotes)) 5 (https://stackoverflow.com/questions/64704889/cant-reach-postgres-container-from-app-container?noredirect=1&lq=1) Can't reach postgres container from app container (https://stackoverflow.com/q/59002414?lq=1) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/59002414/kibana-and-elasticsearch-in-docker-coexist-with-standard-install?noredirect=1&lq=1) Kibana and Elasticsearch in Docker, coexist with standard install (https://stackoverflow.com/q/72807333?lq=1) (Question score (upvotes - downvotes)) 2 (https://stackoverflow.com/questions/72807333/docker-compose-with-php-and-nginx-not-working-on-production?noredirect=1&lq=1) Docker-Compose with PHP and Nginx not working on production (https://stackoverflow.com/q/69722052?lq=1) (Question score (upvotes - downvotes)) 4 (https://stackoverflow.com/questions/69722052/nginx-not-targeting-the-good-port-for-the-api?noredirect=1&lq=1) Nginx not targeting the good port for the api (https://stackoverflow.com/questions/linked/40801772?lq=1) See more linked questions Related (https://stackoverflow.com/q/22111060?rq=3) (Question score (upvotes - downvotes)) 774 (https://stackoverflow.com/questions/22111060/what-is-the-difference-between-expose-and-publish-in-docker?rq=3) What is the difference between "expose" and "publish" in Docker? (https://stackoverflow.com/q/35548843?rq=3) (Question score (upvotes - downvotes)) 39 (https://stackoverflow.com/questions/35548843/does-ports-on-docker-compose-yml-have-the-same-effect-as-expose-on-dockerfile?rq=3) Does "ports" on docker-compose.yml have the same effect as EXPOSE on Dockerfile? (https://stackoverflow.com/q/37770718?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/37770718/how-do-i-configure-docker-compose-to-expose-ports-correctly?rq=3) How do I configure docker compose to expose ports correctly? (https://stackoverflow.com/q/45782600?rq=3) (Question score (upvotes - downvotes)) 17 (https://stackoverflow.com/questions/45782600/difference-between-using-expose-in-dockerfile-and-docker-compose-file?rq=3) Difference between using "expose" in dockerfile and docker-compose file? (https://stackoverflow.com/q/52481836?rq=3) (Question score (upvotes - downvotes)) 7 (https://stackoverflow.com/questions/52481836/how-ports-notation-in-docker-compose-service-works?rq=3) How ports notation in docker compose service works? (https://stackoverflow.com/q/54411378?rq=3) (Question score (upvotes - downvotes)) 6 (https://stackoverflow.com/questions/54411378/does-docker-expose-refer-to-the-container-port-or-the-host-port?rq=3) Does docker EXPOSE refer to the container port or the host port? (https://stackoverflow.com/q/68509085?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/68509085/do-i-have-to-expose-the-port-if-i-am-using-the-ports-config?rq=3) Do I have to expose the port if I am using the ports config? (https://stackoverflow.com/q/69135125?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/69135125/docker-expose-port-internals?rq=3) Docker expose port internals (https://stackoverflow.com/q/69594430?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/69594430/what-is-the-difference-between-target-and-published-ports-into-docker-compose-ym?rq=3) What is the difference between target and published ports into docker-compose.yml container definition? (https://stackoverflow.com/q/74411910?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/74411910/container-port-mapping-concept-confusion?rq=3) container port mapping concept confusion (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/130950/a-box-inside-a-box-puzzle) A box inside a box puzzle (Physics Stack Exchange) (https://physics.stackexchange.com/questions/845329/redshift-of-photons-due-to-gravity-by-another-photon) Redshift of photons due to gravity by another photon (Mi Yodeya) (https://judaism.stackexchange.com/questions/148225/ptij-why-did-mordechai-insist-on-esther-ploughing-%d7%94%d7%97%d7%a8%d7%a9-%d7%aa%d7%97%d7%a8%d7%99%d7%a9%d7%99-at-such-a-cruci) PTIJ: Why did Mordechai insist on Esther ploughing (החרש תחרישי) at such a crucial moment? (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/130962/impossible-but-light-maths-puzzle) Impossible but light maths puzzle (German Language Stack Exchange) (https://german.stackexchange.com/questions/78914/grammatically-speaking-what-is-kann-ermittelt-werden) Grammatically speaking, what is "Kann ... ermittelt werden"? (Physics Stack Exchange) (https://physics.stackexchange.com/questions/845183/why-do-we-take-the-derivative-of-the-basis-vector-when-calcuating-the-accelerati) Why Do We Take the Derivative of the Basis Vector When Calcuating the Acceleration in Polar Coordinates? (Role-playing Games Stack Exchange) (https://rpg.stackexchange.com/questions/214990/does-the-thaumaturges-lantern-implement-provide-a-bonus-to-initiative) Does the Thaumaturge's Lantern Implement provide a bonus to Initiative? (Computer Science Stack Exchange) (https://cs.stackexchange.com/questions/171507/definition-of-binary-heap-data-structure) Definition of binary heap data structure (MathOverflow) (https://mathoverflow.net/questions/489412/can-prime-numbers-be-isolated-as-zeros-of-a-harmonic-wave-function) Can prime numbers be isolated as zeros of a harmonic wave function? (Politics Stack Exchange) (https://politics.stackexchange.com/questions/91024/has-russia-ever-explained-its-u-turn-on-going-to-war-with-ukraine) Has Russia ever explained its U-turn on going to war with Ukraine? (Motor Vehicle Maintenance & Repair Stack Exchange) (https://mechanics.stackexchange.com/questions/98741/car-left-idling-for-extended-period) Car left idling for extended period (English Language & Usage Stack Exchange) (https://english.stackexchange.com/questions/629876/is-raid-kills-bugs-dead-grammatical) Is ‘Raid Kills Bugs Dead’ grammatical? (Hinduism Stack Exchange) (https://hinduism.stackexchange.com/questions/62519/can-one-accept-guru-take-diksha-without-parents-permission) Can one accept Guru/take diksha without parents permission? (English Language & Usage Stack Exchange) (https://english.stackexchange.com/questions/629981/is-there-a-word-for-a-shift-in-a-road-where-it-remains-parallel-to-its-original) Is there a word for a shift in a road where it remains parallel to its original direction? (MathOverflow) (https://mathoverflow.net/questions/489355/na%c3%afve-category-theory-or-pedagogy-and-how-to-introduce-natural-transformatio) "Naïve category theory", or, pedagogy and how to Introduce natural transformations? (Politics Stack Exchange) (https://politics.stackexchange.com/questions/91027/is-it-exceptional-that-states-are-so-transparent-about-geopolitical-decisions-re) Is it exceptional that states are so transparent about geopolitical decisions regarding Ukraine? (Law Stack Exchange) (https://law.stackexchange.com/questions/107792/what-are-the-legal-consequences-of-tesla-germany-holding-back-sick-employees-pa) What are the legal consequences of Tesla Germany holding back sick employees' pay? (Worldbuilding Stack Exchange) (https://worldbuilding.stackexchange.com/questions/265336/what-adaptations-are-necessary-to-make-a-falcon-sized-animal-with-insect-like-fl) What adaptations are necessary to make a falcon-sized animal with insect-like flight? (Law Stack Exchange) (https://law.stackexchange.com/questions/107776/may-the-federal-government-deny-services-opportunities-or-equal-treatment-to-c) May the federal government deny services, opportunities, or equal treatment to customers of businesses they do not like? (MathOverflow) (https://mathoverflow.net/questions/489464/how-to-make-this-system-ergodic) How to make this system ergodic? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/741495/a-problem-with-the-basics-of-opamps) A Problem with the Basics of OpAmps (The Workplace Stack Exchange) (https://workplace.stackexchange.com/questions/200533/how-to-deflect-interview-question-about-most-recent-job) How to deflect interview question about most recent job (Cross Validated) (https://stats.stackexchange.com/questions/662601/why-are-some-independent-variables-having-huge-std-errors) Why are some independent variables having huge std errors? (Cross Validated) (https://stats.stackexchange.com/questions/662618/low-slope-discrimination-questions-usefulness-in-irt) Low slope/discrimination questions: usefulness in IRT? (/feeds/question/40801772) (Feed of this question and its answers) Question feed Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. (https://stackoverflow.com/feeds/question/40801772) () lang-yaml (https://stackoverflow.com) (https://stackoverflow.com) Stack Overflow (/questions) Questions (/help) Help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) Chat (https://stackoverflow.co/) Products (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams) Teams (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising) Advertising (https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent) Talent (https://stackoverflow.co/) Company (https://stackoverflow.co/) About (https://stackoverflow.co/company/press/) Press (https://stackoverflow.co/company/work-here/) Work Here (https://stackoverflow.com/legal) Legal (https://stackoverflow.com/legal/privacy-policy) Privacy Policy (https://stackoverflow.com/legal/terms-of-service/public) Terms of Service (/contact) Contact Us Your Privacy Choices (https://stackoverflow.com/legal/cookie-policy) Cookie Policy (https://stackexchange.com) Stack Exchange Network (https://stackexchange.com/sites#technology) Technology (https://stackexchange.com/sites#culturerecreation) Culture & recreation (https://stackexchange.com/sites#lifearts) Life & arts (https://stackexchange.com/sites#science) Science (https://stackexchange.com/sites#professional) Professional (https://stackexchange.com/sites#business) Business (https://api.stackexchange.com/) API (https://data.stackexchange.com/) Data (https://stackoverflow.blog?blb=1) Blog (https://www.facebook.com/officialstackoverflow/) Facebook (https://twitter.com/stackoverflow) Twitter (https://linkedin.com/company/stack-overflow) LinkedIn (https://www.instagram.com/thestackoverflow) Instagram Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under (https://stackoverflow.com/help/licensing) CC BY-SA . rev 2025.3.14.23880