A platform for community discussion. Free, open, simple.
FEATURE: New install guide for wizard and free domain (#37174)
Rafael dos Santos Silva8c49df6303b4
diff --git a/docs/INSTALL-cloud.md b/docs/INSTALL-cloud.mdindex 9f945d30dce..a3882ed5548 100644--- a/docs/INSTALL-cloud.md+++ b/docs/INSTALL-cloud.md@@ -1,234 +1,349 @@-# Install Discourse on a Cloud Server+# Install Discourse on a Cloud Server> To install and self-host Discourse, follow the steps below. But if you'd rather skip the setup, maintenance, and server management, our official Discourse hosting takes care of everything for you.->-> π [Learn more about Discourse hosting](https://discourse.org/pricing)+>+> [Learn more about Discourse hosting](https://discourse.org/pricing)-> If you prefer to self-host but need help setting it up we have partners who can help.+> If you prefer to self-host but need help setting it up we have partners who can help.> [Click here to explore self-hosting set-up options](https://discourse.org/partners).-**Set up Discourse in the cloud in under 30 minutes** with zero knowledge of Rails or Linux shell. One example-is [DigitalOcean][do], but these steps will work on any **Docker-compatible** cloud provider or local server. This-walkthrough will go through these in detail:+**Set up Discourse in about 10 minutes** with zero knowledge of Rails or Linux shell. Works on any Docker-compatible cloud provider or local server.-**[Before you start](#before-you-start)**+## Contents-1. [Preparing your domain name](#1-preparing-your-domain-name)-2. [Setting up email](#2-setting-up-email)+- [Quick Start](#quick-start)+- [Requirements](#requirements)+- [Installation](#installation)+- [The Setup Wizard](#the-setup-wizard)+- [After Installation](#after-installation)+- [Advanced Configuration](#advanced-configuration)+- [Troubleshooting](#troubleshooting)+- [Optional Features](#optional-features)-**[Installation](#installation)**+----3. [Create new cloud server](#3-create-new-cloud-server)-4. [Access new cloud server](#4-access-your-cloud-server)-5. [Install Prerequisites for Docker](#5-install-prerequisites-for-docker-debianubuntu-based-distro-example)-6. [Install Discourse](#6-install-discourse)-7. [Edit Discourse configuration](#7-edit-discourse-configuration)-8. [Start Discourse](#8-start-discourse)-9. [Register new account and become admin](#9-register-new-account-and-become-admin)-10. [Post-install maintenance](#10-post-install-maintenance)-11. [(Optional) Add more Discourse features](#11-optional-add-more-discourse-features)+## Quick Start-> π€ If you've made it this far and donβt think you have the time to set this up yourself, let us take care of it for you. [Click here to get Discourse hosting](https://discourse.org/pricing).+Run this single command on a fresh Ubuntu/Debian server:-## Before you start--### 1. Preparing your domain name+```bash+wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bash+```-> π Discourse will not work from an IP address, you must own a domain name such as `example.com` to proceed.+That's it! The installer will:-- Already own a domain name? Great. Select a subdomain such as `discourse.example.com` or `talk.example.com` or `forum.example.com` for your Discourse instance.+- Install Docker and git automatically (if not present)+- Download the Discourse Docker configuration+- Launch an interactive setup wizard-- No domain name? Get one! We can [recommend NameCheap](https://www.namecheap.com/domains/domain-name-search/), or there are many other [great domain name registrars](https://www.google.com/search?q=best+domain+name+registrars) to choose from.+> **Don't have a domain name?** No problem! The installer offers free subdomains like `yoursite.discourse.diy` β no purchase required.+>+> **Don't want to set up email?** Skip SMTP and users can log in via Discourse ID with social logins (Google, Facebook, Apple, GitHub).-- Your DNS controls should be accessible from the place where you purchased your domain name. This is where you will create a DNS [ `A` record](https://support.dnsimple.com/articles/a-record/) for the `discourse.example.com` hostname once you know the IP address of the cloud server where you are installing Discourse, as well as enter your [SPF and DKIM records](https://www.google.com/search?q=what+is+spf+dkim) for your email.+----### 2. Setting Up Email+## Requirements-> β οΈ **Email is CRITICAL for account creation and notifications in Discourse.** If you do not properly configure email before bootstrapping YOU WILL HAVE A BROKEN SITE!+### Server Specifications-> π‘ Email here refers to [Transactional Email](https://www.google.com/search?q=what+is+transactional+email) not the usual email service like Gmail, Outlook and/or Yahoo.+| Requirement | Minimum | Recommended |+|-------------|---------|-------------|+| RAM | 1 GB (with swap) | 2 GB+ |+| CPU | 1 core | 2+ cores |+| Disk | 10 GB | 20 GB+ |+| OS | 64-bit Linux | Ubuntu LTS |-- No existing mail server? Check out our [**Recommended Email Providers for Discourse**][mailconfig].+> **Auto-scaling:** The installer automatically tunes `UNICORN_WORKERS` and `db_shared_buffers` based on your server's RAM and CPU.-- Already have a mail server? Great. Use your existing mail server credentials. (Free email services like Gmail/Outlook/Yahoo do not support transactional emails.)+### Supported Cloud Providers-- To ensure mail deliverability, you must add valid [SPF and DKIM records](https://www.google.com/search?q=what+is+spf+dkim) in your DNS. You'll need SMTP credentials from your email provider, which include an SMTP username and password. Log in to your email provider's account, go to SMTP settings or Email API section, and locate/generate your unique SMTP credentials. Keep them secure, as you'll use them during the Discourse configuration. See your mail provider instructions for specifics.+The installer works on any cloud provider with Docker support:-- When creating the DKIM record, some cloud hosting providers may append the domain name automatically to the input for public key. Do check that the created record has the expected public key value.+- [DigitalOcean](https://www.digitalocean.com/?refcode=5fa48ac82415)+- AWS EC2+- Google Cloud Platform+- Linode / Akamai+- Vultr+- Hetzner+- Any VPS with root SSH access-- If you're having trouble getting emails to work, follow our [Email Troubleshooting Guide](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326)+---## Installation-### 3. Create New Cloud Server+### Step 1: Choose Your Domain-Create your new cloud server, for example [on DigitalOcean][do]:+You have two options:-- The default of **the current supported LTS release of Ubuntu Server** works fine. At minimum, a 64-bit Linux OS with a- modern kernel version is required.+| Option | Best For | Setup |+|--------|----------|-------|+| **Free subdomain** (`mysite.discourse.diy`) | Testing, learning, hobby projects | Claim at [id.discourse.com/my/subdomain](https://id.discourse.com/my/subdomain) |+| **Your own domain** (`forum.example.com`) | Production, custom branding | Purchase from a registrar, configure DNS A record |-- The default of **1 GB** RAM works fine for small Discourse communities. We recommend 2 GB RAM for larger communities.+#### Free Subdomain-- The default of **New York** is a good choice for most US and European audiences. Or select a region that is geographically closer to your audience.+Visit [id.discourse.com/my/subdomain](https://id.discourse.com/my/subdomain) anytime to claim your subdomain. You can do this before or during installation:-- Enter your domain `discourse.example.com` as the Droplet name.+1. Log in with your Discourse account (or create one)+2. Choose your desired subdomain name (e.g., `mysite`)+3. When ready to install, click **"Generate Code"** to get a 6-digit verification code (valid for 10 minutes)-Create your new Droplet. You may receive an email with the root password, however, [you should set up SSH keys](https://www.google.com/search?q=digitalocean+ssh+keys), as they are more secure.+> **How it works:** The installer verifies your code with Discourse ID, then automatically creates a DNS A record pointing `yoursite.discourse.diy` to your server's IP. No manual DNS configuration required!-> β οΈ Now you have created your cloud server! Go back to your DNS controls and use the IP address to set up an `A record` for your `discourse.example.com` hostname.+#### Your Own Domain-> β οΈ Note: DigitalOcean now [blocks SMTP ports](https://docs.digitalocean.com/support/why-is-smtp-blocked/) on Droplets by default. You'll need to open a support ticket to get them unblocked before you can install Discourse. (Or try another port, for example, port 2525.)+1. Purchase a domain from a registrar like [Namecheap](https://www.namecheap.com/domains/domain-name-search/)+2. Create a DNS **A record** pointing your subdomain (e.g., `forum.example.com`) to your server's IP address+3. Wait for DNS propagation (can take up to 48 hours, usually much faster)-### 4. Access Your Cloud Server+----Connect to your server via its IP address using SSH, or [Putty][put] on Windows:+### Step 2: Create and Access Your Server- ssh [email protected]+1. **Create a cloud server** on any provider (e.g., a DigitalOcean droplet with Ubuntu)-Either use the root password from the email DigitalOcean sent you when the server was set up, or have a valid SSH key configured on your local machine.+2. **SSH into your server:**+ ```bash+ ssh root@your-server-ip+ ```-### 5. Install Prerequisites for Docker (Debian/Ubuntu based Distro example)+----`sudo apt install git` and follow the [official instructions](https://docs.docker.com/engine/install/ubuntu/) on installing Docker.+### Step 3: Run the Installer-### 6. Install Discourse+```bash+wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bash+```-Clone the [Official Discourse Docker Image][dd] into `/var/discourse`.+The wizard will guide you through:- sudo -s- git clone https://github.com/discourse/discourse_docker.git /var/discourse- cd /var/discourse- chmod 700 containers+1. **Admin email(s)** β Enter the email addresses for admin accounts+2. **Domain selection:**+ - Select **No** for free subdomain β enter your subdomain and verification code+ - Select **Yes** for your own domain β enter your hostname (e.g., `forum.example.com`)+3. **SMTP configuration** β Skip to use Discourse ID login, or configure your email provider-You will need to be root through the rest of the setup and bootstrap process.+After confirming your settings, the installer builds your Discourse (~5-10 minutes).-### 7. Edit Discourse Configuration+> **Note:** SSL certificates via Let's Encrypt are provisioned automatically β no additional configuration required.-Launch the setup tool at+---- ./discourse-setup+## The Setup Wizard-Answer the following questions when prompted:+### SMTP is Optional- Hostname for your Discourse? [discourse.example.com]:- Email address for admin account(s)? [[email protected],[email protected]]:- SMTP server address? [smtp.example.com]:- SMTP port? [587]:- SMTP user name? [[email protected]]:- SMTP password? [pa$$word]:- Let's Encrypt account email? (ENTER to skip) [[email protected]]:- Optional Maxmind License key () [xxxxxxxxxxxxxxxx]:+Unlike previous versions, **you can skip email configuration** during initial setup. When you skip SMTP, the installer automatically enables **Login via Discourse ID**, which provides:-You'll get the SMTP details from your [email](#2-setting-up-email) setup, be sure to complete that section.+- **Email-based login** β Users sign in through id.discourse.com (no SMTP needed)+- **Social logins** β Google, Facebook, Apple, and GitHub authentication built-in+- **Centralized identity** β Users can use the same account across multiple Discourse communities+- **Web push notifications** β Users still receive real-time notifications on all browsers and PWA-enabled devices-> β οΈ If your email provider uses SMTP port 465 (SMTP over SSL) then you might need to make a small change to your `app.yml` configuration file in order for emails to send properly:-> - Check out [this section](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326#p-55742-did-you-enter-email-settings-correctly-2) of the email troubleshooting guide.-> - Edit app.yml with nano or your favorite editor.-> - Find the "DISCOURSE_SMTP_" settings-> - Add `DISCOURSE_SMTP_FORCE_TLS=true` on its own line+This is perfect for:-Let's Encrypt account setup is to give you a free HTTPS certificate for your site, be sure to set that up if you want your site secure.+- Getting started quickly without email provider setup+- Communities that prefer social login over email registration+- Mobile-first communities using the PWA experience-This will generate an `app.yml` configuration file on your behalf, and then kicks off bootstrap. Bootstrapping takes between **2-8 minutes** to set up your Discourse. If you need to change these settings after bootstrapping, you can run `./discourse-setup` again (it will re-use your previous values from the file) or edit `/containers/app.yml` manually with `nano` and then `./launcher rebuild app`, otherwise your changes will not take effect.+> **Note:** If you want traditional email features (email digests, mailing list mode, or email replies), you can configure SMTP later via **Admin β Email** or by re-running the setup wizard.-### 8. Start Discourse+### Automatic Features- Once bootstrapping is complete, your Discourse should be accessible in your web browser via the domain name `discourse.example.com` you entered earlier.+The wizard handles these automatically:-<img src="https://www.discourse.org/images/install/18/discourse-1-congrats.png" width="650">+- **Public IP detection** β Finds your server's IP using multiple services+- **Resource scaling** β Sets optimal `UNICORN_WORKERS` and `db_shared_buffers` based on your hardware+- **Port validation** β Checks that ports 80 and 443 are available+- **DNS verification** β Confirms your domain resolves to this server+- **Swap creation** β Offers to create swap space on low-memory servers-### 9. Register New Account and Become Admin+----Register a new admin account using one of the email addresses you entered before bootstrapping.+## After Installation-<img src="https://www.discourse.org/images/install/18/discourse-2-register.png" width="650">+### Access Your Forum-<img src="https://www.discourse.org/images/install/18/discourse-3-activate.png" width="650">+Once the build completes (5-10 minutes), your forum will be available at:-(If you are unable to register your admin account, check the logs at `/var/discourse/shared/standalone/log/rails/production.log` and see our [Email Troubleshooting checklist](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326).)+- `https://yoursite.discourse.diy` (free subdomain)+- `https://forum.example.com` (your own domain)-After registering your admin account, the setup wizard will launch and guide you through basic configuration of your Discourse.+### Register Your Admin Account-<img src="https://www.discourse.org/images/install/18/discourse-4-wizard-step1.png" width="650">+1. Visit your forum URL+2. Click **Sign Up** or **Log In**+3. If using Discourse ID login: sign in with Google, Facebook, Apple, GitHub, or email via id.discourse.com+4. If using SMTP: use one of the admin emails you entered during setup and check your inbox+5. Complete the in-app setup wizard that appears after registration-After finishing the setup wizard, a popup will welcome you to your new site. It will also link you to the admin guide, which we strongly recommend you look at right away and refer to frequently. The guide provides a setup checklist, important guidance on how to successfully launch your community, and troubleshooting tips.+> **Tip:** Make sure you register with one of the admin emails you entered during installation to get admin privileges.-<img src="https://www.discourse.org/images/install/18/discourse-5-home.png" width="650">+<img src="https://www.discourse.org/images/install/18/discourse-4-wizard-step1.png" width="650">-### 10. Post-Install Maintenance+### Post-Install Security-- We strongly suggest you turn on automatic security updates for your OS. In Ubuntu use the `dpkg-reconfigure -plow unattended-upgrades` command. In CentOS/RHEL, use the [`yum-cron`](https://www.redhat.com/sysadmin/using-yum-cron) package.-- If you are using a password and not a SSH key, be sure to enforce a strong root password. In Ubuntu use the `apt install libpam-cracklib` package. We also recommend `fail2ban` which blocks any IP addresses for 10 minutes that attempt more than 3 password retries.- - **Ubuntu**: `apt install fail2ban`- - **CentOS/RHEL**: `sudo dnf install fail2ban`-- If you need or want a default firewall, [turn on ufw](https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584) for Ubuntu or use `firewalld` for CentOS/RHEL.+We strongly recommend enabling automatic security updates:-> π‘ Discourse will send you an email notification when new versions of Discourse are released. Please stay current to get the latest features and security fixes.+```bash+# Ubuntu/Debian - enable unattended upgrades+dpkg-reconfigure -plow unattended-upgrades-To **upgrade Discourse to the latest version**, visit `https://discourse.example.com/admin/upgrade` in your browser and click the Upgrade button.+# Install fail2ban for brute-force protection+apt install fail2ban+```-Alternatively, you can ssh into your server and rebuild using:+### Upgrading Discourse+**Via web UI (recommended):**+Visit `https://your-forum/admin/upgrade` and click **Upgrade**++**Via command line:**+```bash+cd /var/discourse+./launcher rebuild app```++> Discourse will email you when new versions are available. Stay current for the latest features and security fixes.++---++## Advanced Configuration++### Manual Configuration++For advanced users, edit the configuration file directly:++```bash+nano /var/discourse/containers/app.ymlcd /var/discourse./launcher rebuild app```-The `launcher` command in the `/var/discourse` folder can be used for various kinds of maintenance:+### MaxMind Geolocation++For IP-based geolocation features (country detection, etc.), register for a free [MaxMind GeoLite2 license key](https://www.maxmind.com/en/geolite2/signup) and add it to your `app.yml`:-``` text+```yaml+env:+ DISCOURSE_MAXMIND_LICENSE_KEY: "your_license_key_here"+```++### Launcher Commands++The `launcher` script in `/var/discourse` provides these commands:++```Usage: launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]Commands:- start: Start/initialize a container- stop: Stop a running container- restart: Restart a container- destroy: Stop and remove a container- enter: Use nsenter to get a shell into a container- logs: View the Docker logs for a container- bootstrap: Bootstrap a container for the config based on a template- rebuild: Rebuild a container (destroy old, bootstrap, start new)- cleanup: Remove all containers that have stopped for > 24 hours--Options:- --skip-prereqs Don't check launcher prerequisites- --docker-args Extra arguments to pass when running docker+ start Start/initialize a container+ stop Stop a running container+ restart Restart a container+ destroy Stop and remove a container+ enter Open a shell inside the container+ logs View Docker logs for a container+ bootstrap Bootstrap a container from template+ rebuild Rebuild a container (destroy old, bootstrap, start new)+ cleanup Remove stopped containers (> 24 hours old)```-### 11. (Optional) Add More Discourse Features+---++## Troubleshooting++### Ports 80/443 Already in Use++```bash+# Check what's using the ports+lsof -i :80+lsof -i :443++# Stop conflicting services+systemctl stop nginx # or apache2+systemctl disable nginx+```++### DNS Verification Fails++- Ensure your A record points to the correct server IP+- DNS propagation can take up to 48 hours+- Use `--skip-connection-test` to bypass verification temporarily++### Free Subdomain Issues++- Ensure you're using the same Discourse ID account that claimed the subdomain+- Verification codes expire after **10 minutes** β generate a new one if expired+- Each subdomain can only be claimed by one user++### Build or Bootstrap Errors++```bash+# View container logs+cd /var/discourse+./launcher logs app++# Enter container for debugging+./launcher enter app++# Check Rails production logs+cat /var/discourse/shared/standalone/log/rails/production.log+```++### Low Memory Errors++The installer will offer to create swap space. You can also create it manually:++```bash+# Create 2GB swap+fallocate -l 2G /swapfile+chmod 600 /swapfile+mkswap /swapfile+swapon /swapfile+echo '/swapfile swap swap defaults 0 0' >> /etc/fstab+```++### Email Not Working++If you configured SMTP but emails aren't sending, see the [Email Troubleshooting Guide](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326).++----Do you want...+## Optional Features-* Users to log in *only* via your pre-existing website's registration system? [Configure Single-Sign-On](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045).+After installation, you can enable additional features:-- Users to log in via [Google](https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858), [Twitter](https://meta.discourse.org/t/configuring-twitter-login-for-discourse/13395), [GitHub](https://meta.discourse.org/t/configuring-github-login-for-discourse/13745), or [Facebook](https://meta.discourse.org/t/configuring-facebook-login-for-discourse/13394)?+### Authentication-- Users to post replies via email? [Configure reply via email](https://meta.discourse.org/t/set-up-reply-via-email-support/14003).+- [Google OAuth2](https://meta.discourse.org/t/configuring-google-oauth2-login-for-discourse/15858)+- [GitHub Login](https://meta.discourse.org/t/configuring-github-login-for-discourse/13745)+- [Facebook Login](https://meta.discourse.org/t/configuring-facebook-login-for-discourse/13394)+- [Twitter/X Login](https://meta.discourse.org/t/configuring-twitter-login-for-discourse/13395)+- [Single Sign-On (SSO)](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045)+- [More auth plugins on meta.discourse.org](https://meta.discourse.org/tags/c/plugin/22/auth-plugins)-- Automatic daily backups? [Configure backups](https://meta.discourse.org/t/configure-automatic-backups-for-discourse/14855).--- HTTPS / SSL support?- - Free HTTPS / SSL support with Let's Encrypt is enabled [during standard installation](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#6-edit-discourse-configuration). If you skipped this step, [Configure Let's Encrypt](https://meta.discourse.org/t/setting-up-lets-encrypt-cert-with-discourse-docker/40709).- - Paid HTTPS / SSL support? [Configure SSL](https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847).-- Use a plugin [from Discourse](https://github.com/discourse) or a third party? [Configure plugins](https://meta.discourse.org/t/install-a-plugin/19157)+### Email & Notifications-- Multiple Discourse sites on the same server? [Configure multisite](https://meta.discourse.org/t/multisite-configuration-with-docker/14084).+- [Reply via Email](https://meta.discourse.org/t/set-up-reply-via-email-support/14003)+- [Recommended Email Providers](https://github.com/discourse/discourse/blob/main/docs/INSTALL-email.md) β If you skipped SMTP during setup-- Webhooks when events happen in Discourse? [Configure webhooks](https://meta.discourse.org/t/setting-up-webhooks/49045).+### Operations-- A Content Delivery Network to speed up worldwide access? [Configure a CDN](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857). We recommend [Fastly](http://www.fastly.com/).+- [Automatic Backups](https://meta.discourse.org/t/configure-automatic-backups-for-discourse/14855)+- [Configure a CDN](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857)+- [Multisite Configuration](https://meta.discourse.org/t/multisite-configuration-with-docker/14084)+- [Webhooks](https://meta.discourse.org/t/setting-up-webhooks/49045)+- [Offline Page During Rebuild](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238)-- Import/migrate old content from vBulletin, PHPbb, Vanilla, Drupal, BBPress, etc? [See our open source importers](https://github.com/discourse/discourse/tree/main/script/import_scripts) and our [migration guide](https://meta.discourse.org/t/how-to-migrate-from-one-platform-forum-to-discourse/197236).+### Extending Discourse-- A user friendly [offline page when rebuilding or upgrading?](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238)+- [Install Plugins](https://meta.discourse.org/t/install-a-plugin/19157)+- [Import from Other Platforms](https://meta.discourse.org/t/how-to-migrate-from-one-platform-forum-to-discourse/197236) β vBulletin, phpBB, Vanilla, etc.+- [Embed in WordPress](https://github.com/discourse/wp-discourse)+- [Embed Comments on Static Sites](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963)-- To embed Discourse [in your WordPress install](https://github.com/discourse/wp-discourse), or [on your static HTML site](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963)?+----Help us improve this guide! Feel free to ask about it on [meta.discourse.org][meta], or even better, submit a pull request.+Help us improve this guide! Feel free to ask questions on [meta.discourse.org](https://meta.discourse.org) or submit a pull request.- [dd]: https://github.com/discourse/discourse_docker- [ssh]: https://help.github.com/articles/generating-ssh-keys- [meta]: https://meta.discourse.org- [do]: https://www.digitalocean.com/?refcode=5fa48ac82415- [put]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html- [mailconfig]: https://github.com/discourse/discourse/blob/main/docs/INSTALL-email.md+> Still finding setup too complex? [Let us host Discourse for you](https://discourse.org/pricing) β we handle everything.