This is an old revision of the document!
```markdown # Discourse Installation on Fresh Ubuntu Server with Backup Restoration
## Prerequisites - Fresh Ubuntu Server installation - Root or sudo access - Existing Discourse backup file (.tar.gz) - Domain name pointed to server IP
## Installation Steps
### 1. Initial System Setup ```bash sudo -s apt-get install git ```
### 2. Clone Discourse Docker Repository ```bash git clone https://github.com/discourse/discourse_docker.git /var/discourse cd /var/discourse chmod 700 containers ```
### 3. Edit app.yml for Reverse Proxy Configuration
Before running discourse-setup, edit `/var/discourse/containers/app.yml`:
#### Comment Out SSL Templates
```yaml templates:
- “templates/postgres.template.yml”
- “templates/redis.template.yml”
- “templates/web.template.yml”
- “templates/web.ratelimited.template.yml”
## SSL templates - COMMENTED OUT for reverse proxy setup
# - "templates/web.ssl.template.yml" # - "templates/web.letsencrypt.ssl.template.yml"
```
#### Change Port Mapping
```yaml expose:
- “8080:80” # expose container port 80 on host port 8080
# - “443:443” # https - commented out ```
Rationale: Reverse proxy (nginx) will handle TLS termination and forward HTTP traffic to port 8080. Configuring this before setup avoids needing to rebuild the container later.
### 4. Run Discourse Setup ```bash ./discourse-setup –skip-connection-test ```
Note: This process takes time. Good opportunity for a coffee break.
Configuration Parameters:
Provide these values during setup:
- Hostname: `your-domain.com` - Developer Email: `admin@your-domain.com` - SMTP Server: Your SMTP server address - SMTP Port: Typically `587` for TLS - SMTP Username: Your SMTP username - SMTP Password: Your SMTP password - Notification Email: Email address for outgoing notifications - Let's Encrypt Email: `OFF` (critical - disables Let's Encrypt since TLS will be handled by reverse proxy)
### 5. Copy Backup File to Server
From your local machine (or source location), copy the backup file:
```bash scp -P <ssh-port> your-backup-file.tar.gz user@your-domain.com:/var/discourse/shared/standalone/backups/default/ ```
Notes: - Replace `<ssh-port>` with your SSH port (default is 22, use `-P 22` or omit if default) - Replace `your-backup-file.tar.gz` with your actual backup filename - Adjust username and hostname as needed for your setup
### 6. Restore Backup from Admin Panel
1. Access Discourse at `http://your-domain.com` (or server IP if DNS not yet configured) 2. Navigate to Admin → Backups 3. Locate the uploaded backup file in the list 4. Click Restore on the backup file 5. Confirm the restoration
Note: The restoration process will restart Discourse and may take several minutes depending on backup size.
### 7. Install and Configure Nginx
```bash apt
