Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Install Discourse on Ubuntu 20.04

Rumi, November 14, 2022

Secure the Server

Turn on automatic security updates.

$ sudo dpkg-reconfigure -plow unattended-upgrades

Setup a firewall with ufw.

$ sudo apt-get install ufw
$ sudo ufw default allow outgoing
$ sudo ufw default deny incoming
$ sudo ufw allow 22 comment 'SSH'
$ sudo ufw allow http comment 'HTTP'
$ sudo ufw allow https comment 'HTTPS'
$ sudo ufw enable

Install fail2ban to secure your server

$ sudo apt install fail2ban

Configure fail2ban to Use ufw

Copy the main configuration to avoid unexpected changes during package updates.

$ sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Edit the configuration file with your favorite text editor

$ sudo nano /etc/fail2ban/jail.local

Change the banaction and banaction_allports settings to ufw in the file /etc/fail2ban/jail.local as follows:

banaction = ufw
banaction_allports = ufw

Collect the SMTP Details

Next, you’ll need to collect the SMTP details from your transactional email account. You need the following information:

SMTP server address
SMTP port
SMTP user name
SMTP password

*** This is important, if you don’t have a proper SMTP details, you might not properly install discourse at all.

Access Your Server

Connect to your server instance with SSH. For example, if your server’s IP address is 192.0.2.123:

$ ssh root@192.0.2.123

Install Docker

Docker is an open-source platform for developing, shipping, and running applications. Docker enables you to run Discourse in an isolated and optimized environment. Use these steps to install Docker on your server.

Uninstall old versions such as docker, docker.io, or docker-engine.

$ sudo apt-get remove docker docker-engine docker.io containerd runc

Set up the repository.

$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt update

Install the latest version of Docker Engine.

$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Install Discourse

Create a ‘discourse’ folder in the /var directory.

$ mkdir /var/discourse

Clone the official Discourse git repository in /var/discourse.

$ git clone https://github.com/discourse/discourse_docker.git /var/discourse

Change to the Discourse directory.

$ cd /var/discourse

Launch the setup tool.

$ ./discourse-setup

Answer the prompted questions with your hostname and SMTP details. The Discourse setup script may ask the following questions:

Hostname for your Discourse?: Enter your chosen hostname for your Discourse platform (for example, discourse.example.com).
Email address for admin account(s)?: Choose the email address for your Discourse admin account. It can be any email address. When setting up the Discourse control panel, you need to reuse this email address.
SMTP server address?: Enter your SMTP server address. For example, the SMTP server address for Sendgrid is smtp.sendgrid.net
SMTP port?: Enter your SMTP port. For example, the SMTP port is 587.
SMTP user name?: Enter your SMTP user name. For example, Mailgun provides you with a user name. For Sendgrid, you must set the user name precisely to the string apikey.
SMTP password?: Enter your SMTP user password. For example, Mailgun provides you with a password. For Sendgrid, you can enter your generated API key.
Press ENTER to confirm your settings, and the installation process begins automatically. The setup tool requests a Let's Encrypt SSL certificate by default.

You can run ./discourse-setup again if you need to change these settings.

Start Discourse

To access your Discourse instance, use a web browser to navigate to your domain name, then follow the setup wizard to register your admin account.

Upgrade Discourse

Visit https://your_hostname/admin/upgrade, then click Upgrade to the Latest Version and follow the instructions.

Or, you can upgrade Discourse from the command line as follows:

Change directory to /var/discourse

$ cd /var/discourse

Get the latest version of Discourse

$ sudo git pull

Rebuild the Discourse app

$ sudo ./launcher rebuild app

Src: https://www.vultr.com/docs/how-to-install-discourse-on-ubuntu-20-04/

Administrations Collected Articles Configurations (Linux) DiscourseUbuntuUbuntu 20

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes