# Use Nginx Proxy Manager to manage multiple sites with Discourse

**URL:** <https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344>\
**Category:** Sysadmins\
**Tags:** how-to\
**Created:** [August 17, 2021, 8:21am UTC](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344 "2021-08-17T08:21:04Z")\
**Posts on this page:** 1\
**Showing post:** 35

<div class="post-metadata">

**Author:** ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/579307_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)\
**Post date:** [February 27, 2024, 10:15pm UTC](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344/35 "2024-02-27T22:15:43Z")

</div>

# Just a small how-to for installing multiple instances 🥸

In this case, we’ll start with a clean server install and we might want to restore an old instance afterwards.

### Step 0: Backup!!!

Download the backup. You’ll need it later.

### Step 1: NGINX Proxy Manager

```plaintext
mkdir -p /opt/nginx-proxy-manager
cd /opt/nginx-proxy-manager
nano docker-compose.yml

```

```plaintext
version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80' # http / reserved! 
      - '81:81' # web-admin port
      - '443:443' # https / reserved!  
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

```

and finally: `docker-compose up -d`

_(For even more lazy people, like me sometimes, just use [casaOS](https://casaos.io) (on any port other than ≠ 80/81/443). Just make sure you’re using secure login credentials and an extra proxy host with your SSL certificate for an extra layer of security. You can even set up some firewall rules if you know what you’re doing._

### Step 2: Docker install on Ubuntu server

```plaintext
sudo apt update && apt upgrade -y

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io

```

### Step 3: Discourse install preparation

```plaintext
git clone https://github.com/discourse/discourse_docker.git /var/discourse

cp /var/discourse/samples/standalone.yml /var/discourse/containers/app1.yml
nano /var/discourse/containers/app1.yml

cp /var/discourse/samples/standalone.yml /var/discourse/containers/app2.yml
nano /var/discourse/containers/app2.yml

```

Make any necessary changes to your app.yml files. This includes different exposed ports for each instance (yes, you can even use them for maintenance), mail settings, and so on.

e.g. **app1** gets port 8080/1443 and **app2** gets port 8081/2443 for http/https.

```plaintext
/var/discourse/launcher rebuild app1
/var/discourse/launcher rebuild app2

```

### Step 4: Last but not least configuring the NGINX Proxy Manager

Watch this for a basic understanding of using the NGINX Proxy Manager.

[![](https://global.discourse-cdn.com/meta/original/4X/c/1/2/c127ca85a581596fe16d448edf5a7f048e1aac3d.jpeg "Quick and Easy Local SSL Certificates for Your Homelab!") ](https://www.youtube.com/watch?v=qlcVx-k-02E)

All you need to do is point your proxy host entries to each instance (http port, e.g. 8080 and 8081 with your local or public IP, it’s your decition) and you’ll be able to get free Let’s Encrypt certificates for each instance & domain. Just make sure you’re enabling Force SSL and so on.

### Step 5: Done. Drink a cup of coffee.

In my case it works perfectly.

_There may be some minor issues with the pre-installed software dependencies, but I’m sure you’ll find a solution. Don’t be mad at me for my casaOS tip. But for people who like to play around with their servers, use all available resources in an easy-to-use safe & secure way, I’m sure you’ll find this Docker management interesting._

### Step 6: Finally, restore your previous backups.

---

_[View the full topic](https://meta.discourse.org/t/use-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344)._
