NOTE: This change is only necessary if you won't be using the Traefik reverse proxy. If you do use Traefik, then DO NOT make this change.
`nano compose.yaml` In this file, we want to remove the section for the Traefik reverse proxy. If you are using Traefik as your reverse proxy, then feel free to leave it in. ```yaml volumes: mongodb_data: { driver: local } services: rocketchat: image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest} restart: always labels: traefik.enable: "true" traefik.http.routers.rocketchat.rule: Host(`${DOMAIN:-}`) traefik.http.routers.rocketchat.tls: "true" traefik.http.routers.rocketchat.entrypoints: https traefik.http.routers.rocketchat.tls.certresolver: le environment: MONGO_URL: "${MONGO_URL:-\ mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ ${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\ -mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}} PORT: ${PORT:-3000} DEPLOY_METHOD: docker DEPLOY_PLATFORM: ${DEPLOY_PLATFORM:-} REG_TOKEN: ${REG_TOKEN:-} depends_on: - mongodb expose: - ${PORT:-3000} ports: - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}" mongodb: image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-5.0} restart: always volumes: - mongodb_data:/bitnami/mongodb environment: MONGODB_REPLICA_SET_MODE: primary MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0} MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017} MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb} MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017} MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb} MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true} ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes} ``` From the above we want to remove these lines: ``` labels: traefik.enable: "true" traefik.http.routers.rocketchat.rule: Host(`${DOMAIN:-}`) traefik.http.routers.rocketchat.tls: "true" traefik.http.routers.rocketchat.entrypoints: https traefik.http.routers.rocketchat.tls.certresolver: le ``` In nano, you can put your cursor on the line with "lables:", and then use the CTRL + K hotkey to remove the entire line. Just keeping pressing CTRL + K repeatedly until all of these lines are gone. next, le'ts change the volume mapping line for our MongoDB database to be kept inside of our rocketchat folder. To do that change the line that says: ``` - mongodb_data:/bitnami/mongodb ``` to instead say ``` - ./mongodb_data:/bitnami/mongodb ``` This will keep our compose.yml, .env, and mongodb data all in this folder which makes it much easier to zip up and backup as needed. Now save your changes with CTRL + O, then press Enter to confirm, and exit the nano editor with CTRL + X. Finally, we are ready to pull down the images for our RocketChat instance. `docker compose pull` As the images are pulled, be patient. It can take a bit of time as the images can be large sometimes, and then also have to be extracted (uncompressed). Once the images are pulled down, we'll want to do one more thing. This is just based on my experience, but let's make that "mongodb\_data" folder now, and give it the appropriate permissions it needs: `mkdir mongodb_data` `chmod 777 ./mongodb_data` Let's start our system running with the command: `docker compose up -d && docker compose logs -f` This is really two commands concatenated with the &&. First we tell docker to start the containers, and then we tell it we want to see the logs as it starts. We can stop seeing the logs using the CTRL + C hotkey combination. Once it's up and running, you'll see a lot of text output. You are just looking for errors. If you don't see any errors, you can stop following the logs. Give the system a few minutes to be fully up and running. Now, we just need to setup our reverse proxy. We can open up NGinX Proxy Manager, and add a new Proxy Host. In this case I'm using the IP through my Netbird VPN, but you can use the local network IP, or the Public IP if you prefer. You just need to ensure that "chat.yourdomain.org" is pointing to your NGinx Proxy Manager instance. NGinX will handle the routing from there. In our new proxy host, we'll name our entry with the domain name we want people to use to reach our site. In my case I entered "chat.sysmainit.com". You should use your domain. Next we'll enter the IP we want NGinx proxy manager to use to reach the server where Rocketchat is running. After that enter the port that you set for the HOST\_PORT variable. In my case I set 3000, so that's what I'll enter. Now enable the two options for "Block Common Exploits" and "Websocket Support". Next, select the SSL tab, and in the dropdown that says 'None', select 'Request a New Certificate'. Next, enable the options for 'Force SSL', 'HTTP/2 Support', 'HSTS for both of those entries, then make sure you email is filled in,and accept the LetsEncrypt terms of service. Now click the 'Save' button. You should see the new proxy addition pop-up just close on its own after about 30 seconds. If you don't get any error in the pop up, your proxy is ready. You can now click on the entry in NGinX Proxy Manager, or simply go to the site in your favorite modern browser. You'll be presented with a create account screen to create your first user. This user will be a system admin with all privileges needed to manage your server. Check Out the video for an overview and walk through of the UI. There's a ton here, and you want to make sure to go through and get it setup right. ### Support My Channel and Content **Support my Channel and ongoing efforts through Patreon:** [https://www.patreon.com/awesomeopensource](https://www.patreon.com/awesomeopensource) **Buy me a Beer / Coffee:** https://paypal.me/BrianMcGonagill