<\/span><\/h2>\r\n\r\n\r\n\r\nAs we mentioned before we will install Discourse in an isolated docker environment. Docker by default is available in Ubuntu 20.04 and we just need to execute the following commands to install it:<\/p>\r\n\r\n\r\n\r\n
sudo apt-get install docker.io -y<\/pre>\r\n\r\n\r\n\r\nOnce, the installation is complete start the docker service:<\/p>\r\n\r\n\r\n\r\n
sudo systemctl start docker<\/pre>\r\n\r\n\r\n\r\nAfter starting the service, you need to enable it with the following command:<\/p>\r\n\r\n\r\n\r\n
sudo systemctl enable docker<\/pre>\r\n\r\n\r\n\r\nTo check that the service is up and running, in the terminal execute the command below:<\/p>\r\n\r\n\r\n\r\n
sudo systemctl status docker<\/pre>\r\n\r\n\r\n\r\nYou should see the following output:<\/p>\r\n\r\n\r\n\r\n
root@vps:~# systemctl status docker\r\n\u25cf docker.service - Docker Application Container Engine\r\n Loaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\r\n Active: active (running) since Thu 2021-10-28 17:52:17 UTC; 1h 14min ago\r\nTriggeredBy: \u25cf docker.socket\r\n Docs: https:\/\/docs.docker.com\r\n Main PID: 63601 (dockerd)\r\n Tasks: 32\r\n Memory: 1.8G\r\n CGroup: \/system.slice\/docker.service\r\n \u251c\u2500 63601 \/usr\/bin\/dockerd -H fd:\/\/ --containerd=\/run\/containerd\/containerd.sock\r\n \u251c\u2500274057 \/usr\/bin\/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.17.0.2 -container-port 443\r\n \u2514\u2500274071 \/usr\/bin\/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.17.0.2 -container-port 80\r\n\r\nOct 28 19:03:56 vps.example.com dockerd[63601]: time=\"2021-10-28T19:03:56.213105991Z\" level=info msg=\"ignoring event\" container=1baae1c7e1acfab1fd0bc326a021964b0b02257932a70e5a6100e7ff520e318c>\r\nOct 28 19:03:58 vps.example.com dockerd[265458]: time=\"2021-10-28T19:03:58Z\" level=warning msg=\"file does not exist: \/proc\/sys\/net\/ipv6\/conf\/all\/disable_ipv6 : stat \/proc\/sys\/net\/ipv6\/conf\/all>\r\nOct 28 19:04:31 vps.example.com dockerd[63601]: time=\"2021-10-28T19:04:31.892373712Z\" level=info msg=\"ignoring event\" container=1baae1c7e1acfab1fd0bc326a021964b0b02257932a70e5a6100e7ff520e318c><\/pre>\r\n\r\n\r\n\r\n<\/span>Step 3. Download and Install Discourse<\/span><\/h2>\r\n\r\n\r\n\r\nBefore we download the installation file for Discourse we will make a separate director for it:<\/p>\r\n\r\n\r\n\r\n
sudo mkdir \/var\/www\/discourse\/<\/pre>\r\n\r\n\r\n\r\nClone the discourse with the command bellow:<\/p>\r\n\r\n\r\n\r\n
sudo git clone https:\/\/github.com\/discourse\/discourse_docker.git \/var\/www\/discourse\/<\/pre>\r\n\r\n\r\n\r\nGo into the newly created directory and execute the command for installing Discourse<\/p>\r\n\r\n\r\n\r\n
cd \/var\/www\/discourse\/ \r\n\r\n .\/discourse-setup \r\n\r\n<\/pre>\r\n\r\n\r\n\r\nAfter executing the command for discourse setup, there will be a couple of inputs that need to be entered such as hostname<\/b>, email address for admin<\/b> account, SMTP server<\/b>, SMTP username<\/b>, SMTP password<\/b> and email address for Let’s Encrypt<\/b> as shown below:<\/p>\r\n\r\n\r\n\r\nChecking your domain name . . .\r\nConnection to discourse.yourdomain.com<\/b> succeeded.\r\nEmail address for admin account(s)? [me@example.com,you@example.com]: discourse@yourdomain.com<\/b>\r\nSMTP server address? [smtp.example.com]: smtp.yourdomain.com<\/b>\r\nSMTP port? [587]: \r\nSMTP user name? [user@example.com]: discourse@yourdomain.com<\/b>\r\nSMTP password? [pa$word]: yourstrongpassword\r\nOptional email address for Let's Encrypt warnings? (ENTER to skip) [me@example.com]: ssl-discourse@yourdomain.com<\/b>\r\n<\/pre>\r\n\r\n\r\n\r\nOnce you enter these values, there will be another window to check them again.<\/p>\r\n\r\n\r\n\r\n
Does this look right?\r\n\r\nHostname : discourse.yourdomain.com<\/b>\r\nEmail : discourse@yourdomain.com<\/b>\r\nSMTP address : smtp.yourdomain.com<\/b>\r\nSMTP port : 587\r\nSMTP username : discourse@yourdomain.com<\/b>\r\nSMTP password : yourstrongpassword<\/b>\r\nLet's Encrypt : ssl-discourse@yourdomain.com<\/b>\r\n\r\nENTER to continue, 'n' to try again, Ctrl+C to exit:<\/pre>\r\n\r\n\r\n\r\nHit “Enter<\/b>” to approve them and allow some time for the installation to complete.<\/p>\r\n\r\n\r\n\r\n
Once the installation is completed you can check that the docker container is running properly:<\/p>\r\n\r\n\r\n\r\n
root@vps:~# docker ps<\/pre>\r\n\r\n\r\n\r\nYou should see the following output:<\/p>\r\n\r\n\r\n\r\n
#root@vps:~# docker ps\r\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\r\n1baae1c7e1ac local_discourse\/app \"\/sbin\/boot\" 47 minutes ago Up 16 seconds 0.0.0.0:80->80\/tcp, 0.0.0.0:443->443\/tcp app\r\n<\/pre>\r\n\r\n\r\n\r\n