# Setting up Discourse on a VPS with other sites

**URL:** https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412
**Category:** Self-hosting
**Created:** [21.Апрель.2017 23:16:56 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412 "2017-04-21T23:16:56Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [21.Апрель.2017 23:16:56 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/1 "2017-04-21T23:16:56Z")

</div>

Hello,

I have a Ubuntu 16.04 VPS with Apache running two websites. I want to setup discourse but it seems like it will be a docker container (concept I am new to),.

How do I go about giving discourse a subdomain like [forum.example.com](http://forum.example.com) then ensuring I can install SSL certs with Lets’ Encrypt?

Following instructions here: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

---

<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: [21.Апрель.2017 23:23:36 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/2 "2017-04-21T23:23:36Z")

</div>

> [@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…

---

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [21.Апрель.2017 23:26:14 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/3 "2017-04-21T23:26:14Z")

</div>

I am using Apache, so I would create another VHost in /var/www ?

Or would I create a vhost and set it’s default folder as /var/discourse ?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [21.Апрель.2017 23:52:20 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/4 "2017-04-21T23:52:20Z")

</div>

You’ll need to translate the instructions in the topic @Falco linked to from nginx to Apache.

---

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [22.Апрель.2017 00:22:12 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/5 "2017-04-22T00:22:12Z")

</div>

Hmmm, I don’t know anything about nginx but I can try I guess

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [22.Апрель.2017 03:42:02 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/6 "2017-04-22T03:42:02Z")

</div>

Gets pretty much it, but you configure the host add a reverse proxy.

---

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [22.Апрель.2017 04:42:18 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/7 "2017-04-22T04:42:18Z")

</div>

so I would setup a VHost /var/www/discourse.domain.com and install in discourse in there rather than /var/discourse

And then add a reverse proxy?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [22.Апрель.2017 05:33:46 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/8 "2017-04-22T05:33:46Z")

</div>

No, you don’t setup a vhost anywhere on the host system. You proxy everything for the Discourse subdomain into the container.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [22.Апрель.2017 09:08:35 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/9 "2017-04-22T09:08:35Z")

</div>

There’s a (in my opinion) slightly easier alternative:

1. Configure your Apache to listen on a different port.
2. Set up nginx as a reverse proxy as described above.
3. Set up nginx to proxy the non-Discourse traffic to Apache’s port.

Note that if you want HTTPS (and you do want that), in that case, you’ll have to set this up in nginx.

---

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [22.Апрель.2017 19:01:20 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/10 "2017-04-22T19:01:20Z")

</div>

I have no idea how to do that. All I have done is setup two sites with apache vhost and now want to add discourse

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [22.Апрель.2017 19:13:44 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/11 "2017-04-22T19:13:44Z")

</div>

Instructions for steps 2️⃣ and 3️⃣ have already been posted by @Falco above:

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247?source_topic_id=61412):
>
> @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…

---

<div class="post-metadata">

### Author: ![JoyalV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joyalv/32/71134_2.png) [@JoyalV](https://meta.discourse.org/u/JoyalV)
#### Post date: [22.Апрель.2017 19:30:09 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/12 "2017-04-22T19:30:09Z")

</div>

Idk how to “Configure your Apache to listen on a different port.”

And the instruction says "This guide assumes you already have Discourse working " which I don’t. I am trying to install it onto a VPS with 2 normal sites already configured

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [23.Апрель.2017 14:20:30 UTC](https://meta.discourse.org/t/setting-up-discourse-on-a-vps-with-other-sites/61412/14 "2017-04-23T14:20:30Z")

</div>

You’ll need 2gb to run Apache and Discourse, so if your current host doesn’t have 2 GB then there’s no advantage to using the same host.

If you don’t know how to change Apache port, you can Google that, but it likely means that the other instructions will be difficult to make sense of.
