Atlantic.Net Blog

How to Install Discourse Forum on Debian 10 with Nginx and Let’s Encrypt

Hitesh Jethva
by Atlantic.Net (414 posts) under Tutorials, VPS Hosting
0 Comments

Discourse is open-source forum software written in Ember.js and Ruby on Rails. You can build your own online discussion forums and chat rooms using Discourse. Discourse is mostly used by gamers to create content accessible by the community. It is used by many companies including New Relic, Cloudflare, and Docker to power their communities. Discourse offers a rich set of features including dynamic notifications, infinite scrolling, powerful moderation, spam blocking, two-factor authentication, a comprehensive API, and many more.

In this post, we will explain how to install Discourse Forum with Docker on Debian 10.

Prerequisites

  • A fresh Debian 10 server on the Atlantic.Net Cloud Platform
  • A valid domain name pointed at your server
  • A root password configured on your server

Step 1 – Create Atlantic.Net Cloud Server

First, log in to your Atlantic.Net Cloud Server. Create a new server, choosing Debian 10 as the operating system with at least 2GB RAM. Connect to your Cloud Server via SSH and log in using the credentials highlighted at the top of the page.

Once you are logged in to your Debian 10 server, run the following command to update your base system with the latest available packages.

apt-get update -y

Step 2 – Install Docker

By default, the latest version of Docker is not available in the Debian default repository, so you will need to add the Docker official repository to your system.

First, install the required dependencies using the following command:

apt-get install git apt-transport-https ca-certificates curl gnupg2 software-properties-common -y

Once all the dependencies are installed, add the Docker CE repository with the following command:

curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"

Once the repository is added, update the repository and install Docker CE with the following command:

apt-get update -y
apt-get install docker-ce -y

Once Docker CE is installed, you can proceed to install Discourse.

Step 3 – Install Discourse

First, create a directory for Discourse and download the latest version of Discourse with the following command:

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

Next, change the directory to discourse and start the Discourse installation using the following command:

cd /var/discourse
./discourse-setup

During the installation, you will be asked to provide the Hostname, email, and SMTP details as shown below:

Hostname for your Discourse? [discourse.example.com]: discourse.linuxbuz.com

Checking your domain name . . .
Connection to discourse.linuxbuz.com succeeded.
Email address for admin account(s)? [[email protected],[email protected]]: [email protected]
SMTP server address? [smtp.example.com]: smtp.gmail.com
SMTP port? [587]: 
SMTP user name? [[email protected]]: [email protected]
SMTP password? [pa$$word]: [email protected]
notification email address? [[email protected]]: [email protected]
Optional email address for Let's Encrypt warnings? (ENTER to skip) [[email protected]]: [email protected]
Optional Maxmind License key (ENTER to continue without MAXMIND GeoLite2 geolocation database) [1234567890123456]: 

Provide all the details and hit Enter. You should see the following output:

Does this look right?

Hostname          : discourse.linuxbuz.com
Email             : [email protected]
SMTP address      : smtp.gmail.com
SMTP port         : 587
SMTP username     : [email protected]
SMTP password     : [email protected]
Notification email: [email protected]
Let's Encrypt : [email protected]
Maxmind license: (unset)

ENTER to continue, 'n' to try again, Ctrl+C to exit: 

Confirm all the information and hit Enter to start the installation. Once the installation has been finished, you should get the following output:

+ /usr/bin/docker run --shm-size=512m -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=4 -e UNICORN_SIDEKIQS=1 -e RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 -e RUBY_GC_HEAP_GROWTH_MAX_SLOTS=40000 -e RUBY_GC_HEAP_INIT_SLOTS=400000 -e RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.5 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e LETSENCRYPT_DIR=/shared/letsencrypt -e LC_ALL=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8 -e DISCOURSE_HOSTNAME=discourse.linuxbuz.com -e [email protected] -e DISCOURSE_SMTP_ADDRESS=smtp.gmail.com -e DISCOURSE_SMTP_PORT=587 -e [email protected] -e [email protected] -e DISCOURSE_SMTP_DOMAIN=gmail.com -e [email protected] -e [email protected] -h debian10-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 443:443 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log --mac-address 02:95:89:04:2c:d3 local_discourse/app /sbin/boot
adc3196fb49b6711135c30f88bf6b3f5132e1310e22060f6d907a16ce4e7d963

Step 4 – Access Discourse

Now, open your web browser and access the Discourse web interface using the URL https://discourse.example.com. You should see the following page:

Click on the Register button. You should see the following page:

Provide your email address, username, and password, and click on the Register button. You should see the following page:

You will get an activation email in your mailbox. You can activate your Discourse account by clicking on the activation email.

Conclusion

In the above post, you learned how to install Discourse Forum with Docker on Debian 10. You can implement a Discourse Forum for your organization on your VPS hosting account from Atlantic.Net.

Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Top 10 Best Cybersecurity Training Services
How to Install Ansible on Oracle Linux 8
How to Install LEMP Server on Oracle Linux 8
How to Install and Configure Apache Webserver on Oracle Linux 8
How to Install and Configure Nginx Webserver on Oracle Linux 8

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year


New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Dallas, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4

Canada

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Resources