# Install Discourse, change docker port 80

**URL:** https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114
**Category:** Self-hosting
**Tags:** unsupported-install, docker
**Created:** [July 16, 2015, 3:07pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114 "2015-07-16T15:07:37Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Zonork](https://avatars.discourse-cdn.com/v4/letter/z/db5fbb/32.png) [@Zonork](https://meta.discourse.org/u/Zonork)
#### Post date: [July 16, 2015, 3:07pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/1 "2015-07-16T15:07:38Z")

</div>

Hi, i want install Discourse, i have docker but i need change the port server from 80:80 for 10080:80 because my por 80 is not free.

---

<div class="post-metadata">

### Author: ![Vernam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vernam/32/116431_2.png) [@Vernam](https://meta.discourse.org/u/Vernam)
#### Post date: [July 16, 2015, 9:18pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/2 "2015-07-16T21:18:59Z")

</div>

In you app.yml edit :

> expose:
> 
> - “10080:80”
> - “2222:22”

And

> ./launcher rebuild app

---

<div class="post-metadata">

### Author: ![Zonork](https://avatars.discourse-cdn.com/v4/letter/z/db5fbb/32.png) [@Zonork](https://meta.discourse.org/u/Zonork)
#### Post date: [July 21, 2015, 4:21pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/3 "2015-07-21T16:21:31Z")

</div>

Thank’s for the answer @Vernam

---

<div class="post-metadata">

### Author: ![zeigerpuppy](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@zeigerpuppy](https://meta.discourse.org/u/zeigerpuppy)
#### Post date: [December 19, 2016, 1:03pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/4 "2016-12-19T13:03:52Z")

</div>

Is there a way to so this in the `./discourse-setup` step?  
I’d like to have the alternate port set right from the start rather than having to rebuild.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 19, 2016, 1:15pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/5 "2016-12-19T13:15:45Z")

</div>

Don’t run `discourse-setup`, edit `app.yml` directly, run `launcher bootstrap app`.

---

<div class="post-metadata">

### Author: ![zeigerpuppy](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@zeigerpuppy](https://meta.discourse.org/u/zeigerpuppy)
#### Post date: [December 19, 2016, 1:29pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/6 "2016-12-19T13:29:59Z")

</div>

thanks, that’s easier than mucking about with templates!

---

<div class="post-metadata">

### Author: ![BenRoe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benroe/32/121303_2.png) [@BenRoe](https://meta.discourse.org/u/BenRoe)
#### Post date: [January 31, 2017, 4:16pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/7 "2017-01-31T16:16:39Z")

</div>

Copy the sample file

```
sudo cp samples/standalone.yml containers/app.yml

```

open it

```
sudo nano containers/app.yml

```

and change the port on line 23

```
- "8080:80" # http

```

rebuild it

```
./launcher bootstrap app

```

---

<div class="post-metadata">

### Author: ![Angel\_Grablev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angel_grablev/32/119980_2.png) [@Angel\_Grablev](https://meta.discourse.org/u/Angel_Grablev)
#### Post date: [May 16, 2018, 2:38pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/8 "2018-05-16T14:38:00Z")

</div>

You sir a white knight! Ty a million!

---

<div class="post-metadata">

### Author: ![pihentagy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pihentagy/32/131067_2.png) [@pihentagy](https://meta.discourse.org/u/pihentagy)
#### Post date: [March 6, 2019, 3:23pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/9 "2019-03-06T15:23:33Z")

</div>

Unfortunately this changed port is not considered, and it navigates me to `http://mercury/finish-installation/confirm-email` instead of `http://mercury:3333/finish-installation/confirm-email`.

Also the `http://mercury:3333/u/activate-account/` page is broken, nothing happens if I click the “Click here to activate your account” button.

Console log for the confirmation page:

```plaintext
Loading failed for the <script> with source “http://mercury:3333/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js”. confirm-email:5:1
Loading failed for the <script> with source “http://mercury:3333/assets/wizard-vendor-478203d0e6de278e15e12305ec1c7cc58c60f41a3ceb4c32683113e199fe575c.js”. confirm-email:7:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). Source: ;!function(){var t,e,n,o=0,u=function(t,e){return"function"!=typeof t||t.replaced?t:(e.replaced=!0,e)};if("undefined"!=typeof CustomEvent&&"function"==typeof window.dispatchEvent){var r=function(t){try{if("object"==typeof t&&(t=JSON.stringify(t)),"string"==typeof t)return window.dispatchEvent(new CustomEvent("lprequeststart",{detail:{data:t,requestID:++o}})),o}catch(t){}},s=function(t){try{window.dispatchEvent(new CustomEvent("lprequestend",{detail:t}))}catch(t){}};"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest.prototype&&XMLHttpRequest.prototype.send&&(XMLHttpRequest.prototype.send=u(XMLHttpRequest.prototype.send,(n=XMLHttpRequest.prototype.send,function(t){var e=this,o=r(t);return o&&e.addEventListener("loadend",function(){s({requestID:o,statusCode:e.status})}),n.apply(e,arguments)}))),"function"==typeof fetch&&(fetch=u(fetch,(e=fetch,function(t,n){var o=r(n),u=e.apply(this,arguments);if(o){var c=function(t){s({requestID:o,statusCode:t&&t.status})};u.then(c).catch(c)}return u})));var c=function(t){return u(t,function(){try{this.dispatchEvent(new CustomEvent("lpsubmit"))}catch(t){}return t.apply(this,arguments)})},i=function(){if(document&&document.forms&&document.forms.length>0)for(var t=0;t<document.forms.length;++t)document.forms[t].submit=c(document.forms[t].submit)};document&&"interactive"===document.readyState||"complete"===document.readyState?i():window.addEventListener("DOMContentLoaded",i,!0),Document.prototype.createElement=u(Document.prototype.createElement,(t=Document.prototype.createElement,function(){var e=t.apply(this,arguments);return e&&"FORM"===e.nodeName&&e.submit&&(e.submit=c(e.submit)),e}))}}();. confirm-email:1:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). Source: ;(function(e){if(!e. __REACT_DEVTOOLS_GLOBAL_HOOK__ ){var n=!1,t={_renderers:{},helpers:{},checkDCE:function(e){try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&(n=!0,setTimeout(function(){throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://fb.me/react-perf-use-the-production-build")}))}catch(e){}},inject:function(e){var r=Math.random().toString(16).slice(2);t._renderers[r]=e;var o=n?"deadcode":function(e){try{if("string"==typeof e.version)return e.bundleType>0?"development":"production";var n=Function.prototype.toString;if(e.Mount&&e.Mount._renderNewRootComponent){var t=n.call(e.Mount._renderNewRootComponent);return 0!==t.indexOf("function")?"production":-1!==t.indexOf("storedMeasure")?"development":-1!==t.indexOf("should be a pure function")?-1!==t.indexOf("NODE_ENV")?"development":-1!==t.indexOf("development")?"development":-1!==t.indexOf("true")?"development":-1!==t.indexOf("nextElement")||-1!==t.indexOf("nextComponent")?"unminified":"development":-1!==t.indexOf("nextElement")||-1!==t.indexOf("nextComponent")?"unminified":"outdated"}}catch(e){}return"production"}(e);return t.emit("renderer",{id:r,renderer:e,reactBuildType:o}),r},_listeners:{},sub:function(e,n){return t.on(e,n),function(){return t.off(e,n)}},on:function(e,n){t._listeners[e]||(t._listeners[e]=[]),t._listeners[e].push(n)},off:function(e,n){if(t._listeners[e]){var r=t._listeners[e].indexOf(n);-1!==r&&t._listeners[e].splice(r,1),t._listeners[e].length||(t._listeners[e]=null)}},emit:function(e,n){t._listeners[e]&&t._listeners[e].map(function(e){return e(n)})},supportsFiber:!0,_fiberRoots:{},getFiberRoots:function(e){var n=t._fiberRoots;return n[e]||(n[e]=new Set),n[e]},onCommitFiberUnmount:function(e,n){t.helpers[e]&&t.helpers[e].handleCommitFiberUnmount(n)},onCommitFiberRoot:function(e,n){var r=t.getFiberRoots(e),o=n.current,i=r.has(n),u=null==o.memoizedState||null==o.memoizedState.element;i||u?i&&u&&r.delete(n):r.add(n),t.helpers[e]&&t.helpers[e].handleCommitFiberRoot(n)}};Object.defineProperty(e," __REACT_DEVTOOLS_GLOBAL_HOOK__",{value:t})}}(window))
window. __REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create;
window. __REACT_DEVTOOLS_GLOBAL_HOOK__.nativeMap = Map;
window. __REACT_DEVTOOLS_GLOBAL_HOOK__.nativeWeakMap = WeakMap;
window. __REACT_DEVTOOLS_GLOBAL_HOOK__.nativeSet = Set;

window. __REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function(evt) {
  window.postMessage({
    source: 'react-devtools-detector',
    reactBuildType: evt.reactBuildType,
  }, '*');
});
. confirm-email:1:1
Content Security Policy: The page’s settings blocked the loading of a resource at http://mercury:3333/assets/ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js (“script-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at http://mercury:3333/assets/wizard-vendor-478203d0e6de278e15e12305ec1c7cc58c60f41a3ceb4c32683113e199fe575c.js (“script-src”). 

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 6, 2019, 3:35pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/10 "2019-03-06T15:35:10Z")

</div>

We don’t support running Discourse in a non-standard (80/443) port.

Changing the port in the app.yml file is there to allow you to use a reverse proxy that will listen in a standard port and forward traffic internally to the higher port.

That is an advanced setup and we recommend just using the official guide for people who aren’t familiar with server administration.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 7, 2019, 1:03am UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/11 "2019-03-07T01:03:57Z")

</div>

Running Discourse front end on a custom port is not something we support, you can export it out of docker under a different port and then have the load balancer fix it. BUT having the final place users in production visit be `http://magic.com:8922` is not something we support.

---

<div class="post-metadata">

### Author: ![NathanLei](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@NathanLei](https://meta.discourse.org/u/NathanLei)
#### Post date: [December 17, 2019, 5:04am UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/12 "2019-12-17T05:04:49Z")

</div>

someone can show how to do this..please

---

<div class="post-metadata">

### Author: ![reza\_safaei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/reza_safaei/32/212306_2.png) [@reza\_safaei](https://meta.discourse.org/u/reza_safaei)
#### Post date: [June 6, 2023, 9:04pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/13 "2023-06-06T21:04:30Z")

</div>

Hello, I have a site on port 80. I moved the discourse site to port 8080, but it redirects to the main site.

---

<div class="post-metadata">

### Author: ![Samir\_Sabri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/samir_sabri/32/287380_2.png) [@Samir\_Sabri](https://meta.discourse.org/u/Samir_Sabri)
#### Post date: [March 11, 2024, 4:59pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/14 "2024-03-11T16:59:06Z")

</div>

It’s 2024, any luck on this?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2024, 5:16pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/15 "2024-03-11T17:16:57Z")

</div>

> [@Samir\_Sabri](#):
>
> any luck on this?

What’s this? Running Discourse with an external reverse proxy that controls the web ports is supported, and we even ship with a template that runs Discourse while listening on a unix socket to make this integration seamless.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:36pm UTC](https://meta.discourse.org/t/install-discourse-change-docker-port-80/31114/16 "2024-06-08T12:36:39Z")

</div>

This topic was automatically closed after 3249 days. New replies are no longer allowed.
