# Installing docker on an already running web server?

**URL:** https://meta.discourse.org/t/installing-docker-on-an-already-running-web-server/26308
**Category:** Self-hosting
**Created:** [March 13, 2015, 8:45pm UTC](https://meta.discourse.org/t/installing-docker-on-an-already-running-web-server/26308 "2015-03-13T20:45:45Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [March 13, 2015, 10:10pm UTC](https://meta.discourse.org/t/installing-docker-on-an-already-running-web-server/26308/2 "2015-03-13T22:10:47Z")

</div>

> [@chrisadams](#):
>
> (index files and apache setup networking, etc..)?

The recommended setup in this situation is to have nginx running on 80/443 in front, proxying to Discourse and your other sites as needed.

If you can move your PHP files over to `php-fpm` and not have to go through apache, that’ll be a neater setup than nginx → {apache, discourse}.

This topic has more information:

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247):
>
> @pfaffman edited this heavily 2022.02.24. Blame me if it’s broken. If you want to run other websites on the same machine as Discourse, you need to set up an extra NGINX or HAProxy proxy in front of the Docker container. NOTE: This is for advanced admins This guide assumes you already have Discourse working - if you don’t, it may be hard to tell whether or not the configuration is working. You cannot use ./discourse-setup to set up Discourse if another server is using port 80 or 443. You will…

I would like to heavily recommend against putting apache in front. Without the evented stuff, it’ll fill up the workers with the notification polling.

As for installing in a subdirectory, that existed in a broken form a time ago, then it was ripped out, and there’ve been people asking for it again but it’s tricky due to all the URL generation, and the proxy switching esp. if they’re not on the same machine, and… it’s not available right now.

---

_[View the full topic](https://meta.discourse.org/t/installing-docker-on-an-already-running-web-server/26308)._
