How to install Leantime on Ubuntu 20.04

Managing groups and projects is so complex that people often do not understand it. To help you a bit with the task today I will explain how to install Leantime on Ubuntu 20.04.

What is Leantime?

According to the tool’s website:

Leantime is the open source project management system to make your ideas reality. Manage your ideas, projects, milestones and tasks in one place.

So Leantime will help us to manage projects of any size. All from a neat web interface and with easy access tools.

In these times when we have a lot of teleworking and distance learning, this kind of solutions can be of great help in our daily work.

Let’s get started.

Install LAMP on Ubuntu 20.04

Leantime is a web application built with PHP, and it needs a database manager like MariaDB to keep all the information generated in a safe place.

So, our first step will be to update the system.

sudo apt update
sudo apt upgrade

And then, install in a single command all the packages we need to have LAMP on our server.

sudo apt install apache2 libapache2-mod-php mariadb-server php php php-mysql php-curl php-curl php-curl php-curl php-json php-cgi php-xmlrpc php-gd php-mbstring php-mbstring unzip

After this, we have to open ports 80 and 443 in the system firewall to make it accessible.

sudo ufw allow 80
sudo ufw allow 443

This should be enough.

Prepare MariaDB for Leantime

Before we continue with the process, we need to make some changes with MariaDB. As this is a new installation, there is no root password defined. To achieve this, run.

sudo mysql_secure_installation

You will be prompted for a password. As it doesn’t exist yet, just press ENTER. Thereafter, you will be able to define the new root password.

Change the root password? [Y/n] [Y/n
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables...
... Success!

Then, you will be asked some configuration questions like:

Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Answer all Y and we are ready to go.

Now, with MariaDB configured, you need to create a new database and a new user who has permissions on this database.

First access the MariaDB console

sudo mysql -u root -p

Then create the database with the name you want:

CREATE DATABASE leantime;

Type the user and the password. Again, they can be any values you want. Finally, exit the console.

GRANT ALL PRIVILEGES ON leantime.* TO 'user'@'localhost' IDENTIFIED BY 'pass';
FLUSH PRIVILEGES;
exit;

We can now continue.

Download Leantime on Ubuntu 20.04

Now we can download the latest stable version of Leantime. Since we are working in a server environment, we can use the wget command.

cd /tmp/
wget https://leantime.io/download?wpdmdl=7413 -O leantime.zip

Unzip the file

sudo unzip leantime.zip -d /var/www/html/leantime

Give it the appropriate permissions

sudo chown -R www-data:www-data /var/www/html/leantime
sudo chmod -R 755 /var/www/html/leantime

Enable the new configuration by simply renaming it. You can also make a backup of it.

sudo mv /var/www/html/leantime/config/configuration.sample.php /var/www/html/leantime/config/configuration.php

Now we have to edit this file to make the changes we want. The most urgent, for now, is to set the parameters of the database connection.

sudo nano /var/www/html/leantime/config/configuration.php

At the top of the file, we will find what we need:

/* Database */
public $dbHost="localhost"; //Database host
public $dbUser="user"; //Database username
public $dbPassword="pass"; //Database password
public $dbDatabase="leantime"; //Database name

Save the changes and close the editor. Remember that we have created these values before, and you have to replace them with yours.

Now create a new Apache virtualhost

sudo nano /etc/apache2/sites-available/leantime.conf

And add the following

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/leantime/
    ServerName lean.imaginelinux.test

    <Directory /var/www/html/leantime/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/lean.imaginelinux.test-error_log
    CustomLog /var/log/apache2/lean.imaginelinux.test-access_log common
</VirtualHost>

Remember that ServerName is your domain. Make any adjustments you feel necessary and save your changes.

Enable the new site and the rewrite module.

sudo a2ensite leantime
sudo a2enmod rewrite
sudo systemctl restart apache2

Now we need to access the web interface to complete the installation.

Install Leantime on Ubuntu 20.04 from the web interface

To complete the installation, you have to open a web browser and visit http://your-domain to see the following screen

Install Leantime on Ubuntu 20.04
Install Leantime on Ubuntu 20.04

There, you will only have to create the administrator user.

If all goes well, you will see a screen like this

Creating the admin account
Creating the admin account

Go the link. Now you will see the Login screen. Enter your credentials.

Login screen
Login screen

If the login is successful, you will see a screen like this. You can take the tour or leave it for later.

The Welcome screen of Leantime
The Welcome screen of Leantime

Finally, you will see the control panel. This indicates that the process was successful, and you are ready to use it.

Leantime on Ubuntu 20.04

Conclusion

Managing a project requires well-made tools that streamline the whole process. One of them is Leantime. In this post, you learned how to install it on an Ubuntu 20.04 server.

I hope you found it useful and that you share our post.

1 thought on “How to install Leantime on Ubuntu 20.04”

Leave a Comment

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

Scroll to Top