MyBB Installation Guide

About

Attention: I highly recommend you to use this guide AFTER you bought and configured a domain name for your server.

MyBB is a free and open source PHP forum software.
It is nearly the same as Woltlab except it's free and open source.
You can use it as a forum for your service (or gameserver) if you have your own linux server.
This article exists because the default installation instruction from the MyBB website isn't good enough for non-tech-savvy people.

Installation

First you have to install a webserver and PHP.
If you use Debian then I recommend apache2. It's easy to install and good for beginners.
Install both with sudo apt-get install apache2 php.
Now get the latest version of MyBB from here: https://mybb.com/download/.
For me it was "https://resources.mybb.com/downloads/mybb_1824.zip".
Now upload the .zip file to your server and unzip it with "unzip < filename >".
If "unzip" wasn't found you can install it with sudo apt-get install unzip.

Now we have to install some dependencies and setup the database.
For MyBB to function we have to install the following php modules: sudo apt-get install php-mysql php-xml php-mbstring php-gd.

Now we install the mysql database with sudo apt-get install mariadb-server.
On Debian 10 mysql-server was replaced with mariadb-server, but the commands and syntax is still mysql, so don't worry.
After the installation run the command sudo mysql_secure_installation. No password so just press Enter, then press "Y" for everything and set the new root password to something secure.
You can access mysql via sudo mysql -u root -p. If you put sudo infront you don't need to enter a password, simply press enter and you are in.
Now copy the following lines in to create a new database and user for it. Replace the "MyOwnPasswordHere" with your own secure password.

CREATE DATABASE mybbdb;
CREATE USER 'mybbuser'@'localhost' IDENTIFIED BY 'MyOwnPasswordHere';
GRANT ALL PRIVILEGES ON mybbdb.* TO 'mybbuser'@'localhost';
FLUSH PRIVILEGES;

We are now done with preparation. Now we can move the forum files to our web folder and start the installation.
Create a directory in your web-root-folder: sudo mkdir /var/www/html/forum.
Now move all your files from the zip-file to your forum folder that you just created. There should be a Upload folder from the unzipped folder. Go one folder below it and run sudo cp Upload/* /var/www/html/forum to copy all the files from the folder to your webfolder.
Give back all permissions to your web-user with sudo chown -R www-data:www-data /var/www/html.
Now you can go to your website yourdomain.de/forum and start the installation process.

During the installation you will be asked some questions.
Then just click Next and the database will set itself up.
On the "Board Configuration" Page you can now set your forum-name and Website name. You should leave the rest as is.
On the next page you can create your first user. I highly recommend to name him "Admin" or "root" or something similar. I would NOT use this account for anything except for giving your new users admin rights.
Now you are done and can visit your forum at yourdomain.de/forum

VERY IMPORTANT: For seurity reasons deny access to internal directories.
For nginx simply use this code snippet:
location ~ /(inc|uploads/avatars) {
  deny all;
}
For apache2 simply rename the htaccess.txt to .htaccess and enable htaccess support via the apache2 config if it isn't enabled already.

New Theme

You probably don't like the default MyBB theme and that is ok. I don't like it either.Let's take a better one.
A good and minimalistic theme is Flatty. (source: https://community.mybb.com/mods.php?action=view&pid=617)
Download it from here https://community.mybb.com/mods.php?action=download&pid=617.
Unzip it and Upload everything in the "Upload" folder into your "/forum" folder on your webserver.
Then login as Admin on the MyBB Forum, goto Admin CP (on the left top of the forum).
Go to "Templates & Style" and then to "Import a theme" (in the middle, written in light grey)
Locate your flatty.xml file (from the zip file that you downloaded), type in a new name like "FlattyTheme", check all 3 boxes at the bottom and then press the "Import Theme" button.
Now go to "Themes" on the left, and click the small Arrow besides the FlattyTheme in the list that says "Set as Default" when you hover over it.
Now you have set a new default theme.
To set a new Logo simply upload a file named "logo.png" to "forum/images/flatty/logo.png". (It should be 200px in Height)

Activation Mail not sending

I recently had the problem that the activation mail for new accounts wasn't being sent by mybb.
If a test mail with the mail() function isn't sending for you then install sendmail and try it again, it should work.
If a test mail was correctly sent but mybb isn't sending mails then try the following:

The setting was on "PHP Mail" and the mail() function in PHP was successfully sending emails.
I had to change the Mail-Setting to "SMTP".
SMTP basically means: Let another mailserver send the mail for me.

If you use googlemail you have to activate the "Use less secure apps" Setting in your desired GMail account.
Go to https://myaccount.google.com/ and on the left on security. Now scroll down to "Access by less secure apps" and enable it.

Go to your forum and login as admin. Go to the Admin CP and in the settings search for "Mail" in the top right searchbox.
Scroll down until you see the "Mail" dropdown menu and select SMTP.
SMTP redirects mail to an SMTP Server and makes that server send the mail.
If you have a gmail account enter "smtp.gmail.com" as the server, port 465, user is your email, password your password, and encryption is SSL.
Click on the Save button (in this box) and now your mail should be working!
If you don't receive an activation mail check your mail logs in "Tools and Maintanence"->"Mails Log".