Setup Misago on your Server

In the previous guides, we created a server on DigitalOcean and configured the domain.

We are finally ready to set up Misago!

Getting on the server

Prepare your droplet's IP address and password (if you haven't selected the SSH key as an authentication method).

If you are on Linux or Mac, you are ready to sign in to your server. If you are on Windows, you will first need to install an SSH client. DigitalOcean has a guide for connecting to a droplet using PuTTY on Windows.

*nix-like systems already implement program for connecting to server. Open your terminal and run following command, replacing the part after @ with your droplet's IP address:

ssh root@ip-addres

After running this command, your terminal will attempt to connect to your droplet using the root username. Since this is your first connection to the server, you will be prompted to confirm. Enter yes and press Enter to proceed:

If you've selected a password as the authentication method, you will now be asked to enter it.

After successful sign-in, you should see a welcome message from your server:

Updating server's software

You are now connected to your server as the root user. Digital Ocean has already performed several configurations on the server, but for safety, it's recommended to do an update.

We can accomplish that by running a series of commands. If any of the commands prompt you to confirm whether you wish to continue, type y and press the "Enter" key to confirm. If the updater warns you that one of the files to be updated would overwrite a locally modified file, select the option to "keep the local version currently installed."

The commands to run are as follows:

1. `apt-get update`
2. `apt-get upgrade`
3. `apt-get dist-upgrade`
4. `do-release-upgrade`

Enable brute-force protection

The internet is patrolled by bots trying to brute-force "root" user passwords on discovered servers. In addition to setting a long and hard-to-guess password for "root," we can also enable a mechanism that will ban an IP address from logging into the server for 10 minutes if they fail to enter the correct password three times.

To do that run the following command:

apt-get install fail2ban

If you are asked for confirmation, continue as you did in the previous step.

Downloading Misago on the server

Run the following command:

git clone https://github.com/rafalp/misago_docker.git --depth=1

This will download the latest version of Misago from GitHub to the misago_docker directory:

Run the cd misago_docker command to enter the directory containing our Misago site. You can use the ls command to list the contents of the current directory:

We can see that a bunch of files and directories have been downloaded, including LICENSE, appctl, backups, logs, and more. Your list may be different depending on the changes in the new Misago versions.

Running a Misago setup

One item on the list stands out more than the rest: appctl.

This is an executable script that Misago provides for administrators to make it easier to set up and manage Misago sites.

To run it, enter ./appctl. This will result in a list of available options being displayed:

We see that we can use the setup option to set up a new Misago site. To use the option, run ./appctl followed by the option's name:

./appctl setup

You will be asked to enter the hostname for your site. Enter the domain name you have pointed to the server and confirm it by pressing Enter.

Note: You may remember that in the domain guide, we created two records for our domain: one without "www" and the other with. Enter either of those. Misago will create a 301 redirection from the other domain to ensure there are no duplicate content problems with links to your site.

Next, enter the email address for the Let's Encrypt certificate. Misago uses the Let's Encrypt service to secure your users' connections with your site. It is 100% free, safe, and GDPR compliant. However, Let's Encrypt requires your email address to be able to contact you in case there is something wrong with your HTTPS certificate.

You will also be asked to enter the language code for your site's locale. The locale affects the language of the site's interface and the search feature's accuracy. You can find a list of all supported locales here.

Note: You can always change your answers later using the dedicated option in ./appctl.

Continue answering the questions until you are asked if you want to initialize the default database. Confirm this with "Y" and grab a cup of coffee (or a tea) as the installer does its magic.

Eventually, you will be asked to enter a username, email, and password for your superuser account. Make sure you remember these inputs. At the start, this will be the only user on your site with access to the admin control panel.

After the user is created, the setup will perform a few more actions before finally displaying the "setup completed" message. You should now be able to visit your site and log in to your account using the credentials you entered during the setup.

If your browser tells you that there is an HTTPS error on your site, wait a few minutes and try again. If your site still lacks HTTPS after a few minutes, it may be because you have reached the [limit on the number of certificates]](https://letsencrypt.org/docs/rate-limits/) that Let's Encrypt can issue for a single domain in a week.

Lastly, visit yourdomain.com/admincp/ in your browser and log in to the admin control panel to set up the site name, categories, and other settings.

Note: If you are still signed in to your server, run docker system prune to delete no longer necessary Docker build caches and free up extra disk space.


Next guide: Upgrading your Misago to latest version

Last updated