# Running Discourse docker alongside Apache

**URL:** https://meta.discourse.org/t/running-discourse-docker-alongside-apache/161625
**Category:** Self-hosting
**Created:** [August 21, 2020, 7:17am UTC](https://meta.discourse.org/t/running-discourse-docker-alongside-apache/161625 "2020-08-21T07:17:18Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [August 21, 2020, 9:00am UTC](https://meta.discourse.org/t/running-discourse-docker-alongside-apache/161625/6 "2020-08-21T09:00:52Z")

</div>

> [@rebelCoder](#):
>
> `8081`

In the case (example configuration) above, you should only expose port 8081 on Docker (and not port 80 or port 443).

Ports 80 and 443 are exposed by the reverse proxy outside the container and that traffic is proxied to port 8081 (in your example above), the port you have exposed inside (mapped to 80 inside).

This will work only if you have mapped port 80 inside the container to port 8081 (exposed to the host).

```plaintext
expose:
  - "8081:80" # http

```

Hope this helps.

PS: @rebelCoder, your apache2 configuration on the SSL side is missing a lot of configuration info you need.

See this post:

> [@I want to install using a reverse proxy for Apache](https://meta.discourse.org/t/i-want-to-install-using-a-reverse-proxy-for-apache/158519/5):
>
> Dear @Teraterayuki … Here is an example set of working Apache2 virtual hosts for a reverse proxy to a unix domain socket in a Discourse container: Port 80 \<VirtualHost \*:80\> ServerName mysite.mydomain.com ServerAdmin webmaster@localhost ProxyPreserveHost On #ProxyPass / http://127.0.0.1:8888/ #ProxyPassReverse / http://127.0.0.1:8888/ # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg.…

---

_[View the full topic](https://meta.discourse.org/t/running-discourse-docker-alongside-apache/161625)._
