{"id":13550650,"url":"https://github.com/revoltchat/self-hosted","last_synced_at":"2025-05-14T16:05:46.551Z","repository":{"id":37441779,"uuid":"403026514","full_name":"revoltchat/self-hosted","owner":"revoltchat","description":"Instructions and resources to deploy Revolt using Docker.","archived":false,"fork":false,"pushed_at":"2025-03-08T19:07:07.000Z","size":802,"stargazers_count":1266,"open_issues_count":13,"forks_count":158,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-14T22:08:01.855Z","etag":null,"topics":["docker","revolt","revoltchat","self-hosted","self-hosting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revoltchat.png","metadata":{"funding":{"ko_fi":"insertish","custom":"https://insrt.uk/donate"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-04T10:23:42.000Z","updated_at":"2025-04-14T02:18:29.000Z","dependencies_parsed_at":"2024-03-28T14:53:39.680Z","dependency_job_id":"b6a9d31e-5fbd-4459-8697-048f48f9e3af","html_url":"https://github.com/revoltchat/self-hosted","commit_stats":{"total_commits":82,"total_committers":12,"mean_commits":6.833333333333333,"dds":0.5,"last_synced_commit":"71e9b9579bd5858ed5b774a5313fc2976e6b0fee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revoltchat%2Fself-hosted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revoltchat%2Fself-hosted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revoltchat%2Fself-hosted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revoltchat%2Fself-hosted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revoltchat","download_url":"https://codeload.github.com/revoltchat/self-hosted/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968914,"owners_count":21191162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","revolt","revoltchat","self-hosted","self-hosting"],"created_at":"2024-08-01T12:01:35.760Z","updated_at":"2025-05-14T16:05:46.542Z","avatar_url":"https://github.com/revoltchat.png","language":"JavaScript","funding_links":["https://ko-fi.com/insertish","https://insrt.uk/donate"],"categories":["置顶","JavaScript","docker"],"sub_categories":["06、企业协作平台"],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003e\n  Revolt Self-Hosted\n  \n  [![Stars](https://img.shields.io/github/stars/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/stargazers)\n  [![Forks](https://img.shields.io/github/forks/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/network/members)\n  [![Pull Requests](https://img.shields.io/github/issues-pr/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/pulls)\n  [![Issues](https://img.shields.io/github/issues/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/issues)\n  [![Contributors](https://img.shields.io/github/contributors/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/graphs/contributors)\n  [![License](https://img.shields.io/github/license/revoltchat/self-hosted?style=flat-square\u0026logoColor=white)](https://github.com/revoltchat/self-hosted/blob/main/LICENSE)\n\u003c/h1\u003e\nSelf-hosting Revolt using Docker\n\u003c/div\u003e\n\u003cbr/\u003e\n\nThis repository contains configurations and instructions that can be used for deploying Revolt.\n\n\u003e [!WARNING]\n\u003e If you are updating an instance from before November 28, 2024, please see the [notices section](#notices) at the bottom of this README!\n\n\u003e [!IMPORTANT]\n\u003e A list of security advisories is [provided at the bottom](#security-advisories).\n\n\u003e [!NOTE]\n\u003e Please consult _[What can I do with Revolt, and how do I self-host?](https://developers.revolt.chat/faq.html#admonition-what-can-i-do-with-revolt-and-how-do-i-self-host)_ on our developer site for information about licensing and brand use.\n\n\u003e [!NOTE]\n\u003e amd64 builds are not currently available for the web client.\n\n\u003e [!NOTE]\n\u003e This guide does not include working voice channels ([#138](https://github.com/revoltchat/self-hosted/pull/138#issuecomment-2762682655)). A [rework](https://github.com/revoltchat/backend/issues/313) is currently in progress.\n\n## Table of Contents\n- [Deployment](#deployment)\n- [Updating](#updating)\n- [Advanced Deployment](#advanced-deployment)\n- [Additional Notes](#additional-notes)\n  - [Custom Domain](#custom-domain)\n  - [Placing Behind Another Reverse-Proxy or Another Port](#placing-behind-another-reverse-proxy-or-another-port)\n  - [Insecurely Expose the Database](#insecurely-expose-the-database)\n  - [Mongo Compatibility](#mongo-compatibility)\n  - [Making Your Instance Invite-only](#making-your-instance-invite-only)\n- [Notices](#notices)\n- [Security Advisories](#security-advisories)\n\n## Deployment\n\nTo get started, find yourself a suitable server to deploy onto, we recommend starting with at least 2 vCPUs and 2 GB of memory.\n\n\u003e [!TIP]\n\u003e\n\u003e **We've partnered with Hostinger to bring you a 20% discount off VPS hosting!**\n\u003e\n\u003e 👉 https://www.hostinger.com/vps-hosting?REFERRALCODE=REVOLTCHAT\n\u003e\n\u003e We recommend using the _KVM 2_ plan at minimum!\\\n\u003e Our testing environment for self-hosted currently sits on a KVM 2 instance, and we are happy to assist with issues.\n\nThe instructions going forward will use Hostinger as an example hosting platform, but you should be able to adapt these to other platforms as necessary. There are important details throughout.\n\n![Select the location](.github/guide/hostinger-1.location.webp)\n\nWhen asked, choose **Ubuntu Server** as your operating system; this is used by us in production, and we recommend its use.\n\n![Select the operating system](.github/guide/hostinger-2.os.webp)\n\nIf you've chosen to go with Hostinger, they include integrated malware scanning, which may be of interest:\n\n![Consider malware scanning](.github/guide/hostinger-3.malware.webp)\n\nYou should set a secure root password for login (_or disable password login after setup, which is explained later! but you shouldn't make the password trivial until after this is secured at least!_) and we recommend that you configure an SSH key:\n\n![Configuration unfilled](.github/guide/hostinger-4.configuration.webp)\n![Configuration filled](.github/guide/hostinger-5.configuration.webp)\n\nMake sure to confirm everything is correct!\n\n![Confirmation](.github/guide/hostinger-6.complete.webp)\n\nWait for your VPS to be created...\n\n| ![Wait for creation](.github/guide/hostinger-7.wait.webp) | ![Wait for creation](.github/guide/hostinger-8.connect.webp) |\n| --------------------------------------------------------- | ------------------------------------------------------------ |\n\nAfter installation, SSH into the machine:\n\n```bash\n# use the provided IP address to connect:\nssh root@\u003cip address\u003e\n# .. if you have a SSH key configured\nssh root@\u003cip address\u003e -i path/to/id_rsa\n```\n\nAnd now we can proceed with some basic configuration and securing the system:\n\n```bash\n# update the system\napt-get update \u0026\u0026 apt-get upgrade -y\n\n# configure firewall\nufw allow ssh\nufw allow http\nufw allow https\nufw default deny\nufw enable\n\n# if you have configured an SSH key, disable password authentication:\nsudo sed -E -i 's|^#?(PasswordAuthentication)\\s.*|\\1 no|' /etc/ssh/sshd_config\nif ! grep '^PasswordAuthentication\\s' /etc/ssh/sshd_config; then echo 'PasswordAuthentication no' |sudo tee -a /etc/ssh/sshd_config; fi\n\n# reboot to apply changes\nreboot\n```\n\nYour system is now ready to proceed with installation, but before we continue, you should configure your domain.\n\n![Cloudflare DNS configuration](.github/guide/cloudflare-dns.webp)\n\nYour domain (or a subdomain) should point to the server's IP (A and AAAA records) or CNAME to the hostname provided.\n\nNext, we must install the required dependencies:\n\n```bash\n# ensure Git and Docker are installed\napt-get update\napt-get install ca-certificates curl git micro\ninstall -m 0755 -d /etc/apt/keyrings\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc\nchmod a+r /etc/apt/keyrings/docker.asc\n\necho \\\n  \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \\\n  $(. /etc/os-release \u0026\u0026 echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\n\napt-get update\napt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin\n```\n\nNow, we can pull in the configuration for Revolt:\n\n```bash\ngit clone https://github.com/revoltchat/self-hosted revolt\ncd revolt\n```\n\nGenerate a configuration file by running:\n\n```bash\nchmod +x ./generate_config.sh\n./generate_config.sh your.domain\n```\n\nYou can find [more options here](https://github.com/revoltchat/backend/blob/df074260196f5ed246e6360d8e81ece84d8d9549/crates/core/config/Revolt.toml), some noteworthy configuration options:\n\n- Email verification\n- Captcha\n- A custom S3 server\n- iOS \u0026 Android notifications (Requires Apple/Google developer accounts)\n\nIf you'd like to edit the configuration, just run:\n\n```bash\nmicro Revolt.toml\n```\n\nFinally, we can start up Revolt. First, run it in the foreground with:\n\n```bash\ndocker compose up\n```\n\nIf it runs without any critical errors, you can stop it with \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eC\u003c/kbd\u003e and run it detached (in the background) by appending `-d`.\n\n```bash\ndocker compose up -d\n```\n\n## Updating\n\nBefore updating, ensure you consult the notices at the top of this README, **as well as** [the notices](#notices) at the bottom, to check if there are any important changes to be aware of.\n\nPull the latest version of this repository:\n\n```bash\ngit pull\n```\n\nCheck if your configuration file is correct by opening [the reference config file](https://github.com/revoltchat/backend/blob/df074260196f5ed246e6360d8e81ece84d8d9549/crates/core/config/Revolt.toml) and your `Revolt.toml` to compare changes.\n\nThen pull all the latest images:\n\n```bash\ndocker compose pull\n```\n\nThen restart the services:\n\n```bash\ndocker compose up -d\n```\n\n## Advanced Deployment\n\nThis guide assumes you know your way around a Linux terminal and Docker.\n\nPrerequisites before continuing:\n\n- [Git](https://git-scm.com)\n- [Docker](https://www.docker.com)\n\nClone this repository.\n\n```bash\ngit clone https://github.com/revoltchat/self-hosted revolt\ncd revolt\n```\n\nCreate `.env.web` and download `Revolt.toml`, then modify them according to your requirements.\n\n\u003e [!WARNING]\n\u003e The default configurations are intended exclusively for testing and will only work locally. If you wish to deploy to a remote server, you **must** edit the URLs in `.env.web` and `Revolt.toml`. Please reference the section below on [configuring a custom domain](#custom-domain).\n\n```bash\necho \"HOSTNAME=http://local.revolt.chat\" \u003e .env.web\necho \"REVOLT_PUBLIC_URL=http://local.revolt.chat/api\" \u003e\u003e .env.web\nwget -O Revolt.toml https://raw.githubusercontent.com/revoltchat/backend/main/crates/core/config/Revolt.toml\n```\n\nThen start Revolt:\n\n```bash\ndocker compose up -d\n```\n\n## Additional Notes\n\n### Custom Domain\n\nTo configure a custom domain, you will need to replace *all* instances of `local.revolt.chat` in `Revolt.toml` and `.env.web` to your chosen domain (here represented as `example.com`), like so:\n\n```diff\n# .env.web\n- REVOLT_PUBLIC_URL=http://local.revolt.chat/api\n+ REVOLT_PUBLIC_URL=http://example.com\n```\n\n```diff\n# Revolt.toml\n- app = \"http://local.revolt.chat\"\n+ app = \"http://example.com\"\n```\n\nIn the case of `HOSTNAME`, you must strip the protocol prefix:\n```diff\n# .env.web\n- HOSTNAME=http://example.com\n+ HOSTNAME=example.com\n```\n\nYou will likely also want to change the protocols to enable HTTPS:\n\n```diff\n# .env.web\n- REVOLT_PUBLIC_URL=http://example.com\n+ REVOLT_PUBLIC_URL=https://example.com\n```\n\n```diff\n# Revolt.toml\n- app = \"http://example.com\"\n+ app = \"https://example.com\"\n\n- events = \"ws://example.com/ws\"\n+ events = \"wss://example.com/ws\"\n```\n\n### Placing Behind Another Reverse-Proxy or Another Port\n\nIf you'd like to place Revolt behind another reverse proxy or on a non-standard port, you'll need to edit `compose.yml`. \n\nOverride the port definitions on `caddy`:\n\n```yml\n# compose.yml\nservices:\n  caddy:\n    ports:\n      - \"1234:80\"\n```\n\n\u003e [!WARNING]\n\u003e This file is not included in `.gitignore`. It may be sufficient to use an override file, but that will not remove port `80` / `443` allocations.\n\nUpdate the hostname used by the web server:\n\n```diff\n# .env.web\n- HOSTNAME=http://example.com\n+ HOSTNAME=:80\n```\n\nYou can now reverse proxy to \u003chttp://localhost:1234\u003e.\n\n### Insecurely Expose the Database\n\nYou can insecurely expose the database by adding a port definition:\n\n```yml\n# compose.override.yml\nservices:\n  database:\n    ports:\n      - \"27017:27017\"\n```\n\nFor obvious reasons, be careful doing this.\n\n### Mongo Compatibility\n\nOlder processors may not support the latest MongoDB version; you may pin to MongoDB 4.4 as such:\n\n```yml\n# compose.override.yml\nservices:\n  database:\n    image: mongo:4.4\n```\n\n### Making Your Instance Invite-only\n\nEnable invite-only mode by setting `invite_only` in `Revolt.toml` to `true`.\n\nCreate an invite:\n\n```bash\n# drop into mongo shell\ndocker compose exec database mongosh\n\n# create the invite\nuse revolt\ndb.invites.insertOne({ _id: \"enter_an_invite_code_here\" })\n```\n\n## Notices\n\n\u003e [!IMPORTANT]\n\u003e If you deployed Revolt before [2022-10-29](https://github.com/minio/docs/issues/624#issuecomment-1296608406), you may have to tag the `minio` image release if it's configured in \"fs\" mode.\n\u003e\n\u003e ```yml\n\u003e image: minio/minio:RELEASE.2022-10-24T18-35-07Z\n\u003e ```\n\n\u003e [!IMPORTANT]\n\u003e If you deployed Revolt before [2023-04-21](https://github.com/revoltchat/backend/commit/32542a822e3de0fc8cc7b29af46c54a9284ee2de), you may have to flush your Redis database.\n\u003e\n\u003e ```bash\n\u003e # for stock Redis and older KeyDB images:\n\u003e docker compose exec redis redis-cli\n\u003e # ...or for newer KeyDB images:\n\u003e docker compose exec redis keydb-cli\n\u003e\n\u003e # then run:\n\u003e FLUSHDB\n\u003e ```\n\n\u003e [!IMPORTANT]\n\u003e As of 30th September 2024, Autumn has undergone a major refactor, which requires a manual migration.\n\u003e\n\u003e To begin, add a temporary container that we can work from:\n\u003e\n\u003e ```yml\n\u003e # compose.override.yml\n\u003e services:\n\u003e   migration:\n\u003e     image: node:21\n\u003e     volumes:\n\u003e       - ./migrations:/cwd\n\u003e     command: \"bash -c 'while true; do sleep 86400; done'\"\n\u003e ```\n\u003e\n\u003e Then switch to the shell:\n\u003e\n\u003e ```bash\n\u003e docker compose up -d database migration\n\u003e docker compose exec migration bash\n\u003e ```\n\u003e\n\u003e Now we can run the migration:\n\u003e\n\u003e ```bash\n\u003e cd /cwd\n\u003e npm i mongodb\n\u003e node ./20240929-autumn-rewrite.mjs\n\u003e ```\n\n\u003e [!IMPORTANT]\n\u003e As of November 28, 2024, the following breaking changes have been applied:\n\u003e - Rename config section `api.vapid` -\u003e `pushd.vapid`\n\u003e - Rename config section `api.fcm` -\u003e `pushd.fcm`\n\u003e - Rename config section `api.apn` -\u003e `pushd.apn`\n\u003e\n\u003e These will NOT automatically be applied to your config and must be changed/added manually.\n\u003e \n\u003e\n\u003e The following components have been added to the compose file:\n\u003e - Added `rabbit` (RabbitMQ) and `pushd` (Revolt push daemon)\n\n## Security Advisories\n\n- (`2024-06-21`) [GHSA-f26h-rqjq-qqjq revoltchat/backend: Unrestricted account creation.](https://github.com/revoltchat/backend/security/advisories/GHSA-f26h-rqjq-qqjq)\n- (`2024-12-17`) [GHSA-7f9x-pm3g-j7p4 revoltchat/january: January service can call itself recursively, causing heavy load.](https://github.com/revoltchat/january/security/advisories/GHSA-7f9x-pm3g-j7p4)\n- (`2025-02-10`) [GHSA-8684-rvfj-v3jq revoltchat/backend: Webhook tokens are freely accessible for users with read permissions.](https://github.com/revoltchat/backend/security/advisories/GHSA-8684-rvfj-v3jq)\n- (`2025-02-10`) [GHSA-h7h6-7pxm-mc66 revoltchat/backend: Nearby message fetch requests can be crafted to fetch entire message history.](https://github.com/revoltchat/backend/security/advisories/GHSA-h7h6-7pxm-mc66)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevoltchat%2Fself-hosted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevoltchat%2Fself-hosted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevoltchat%2Fself-hosted/lists"}