How to Install Leantime on Ubuntu 23.10

Leantime is an open-source project management and collaboration platform designed for small and medium-sized businesses and teams. It provides features for task and project management, collaboration, and time tracking. Users can create and manage projects, tasks, and milestones, set deadlines, and collaborate with team members on various project-related activities.

Prerequisites

  • Ubuntu 23.10 server set up and have root or sudo access

Update Packages

Update the package list to make sure you have the latest information about available packages,

apt update -y

apt upgrade -y

Install Required Softwares

Install the necessary softwares, including Apache2, PHP, and other dependencies:

apt install vim apache2 mariadb-server libapache2-mod-php php php-gmp php-bcmath php-gd php-json php-mysql php-curl php-mbstring php-intl php-imagick php-xml php-zip bzip2 zip unzip imagemagick php-fpm  php-fileinfo

Enable Apache Modules,

a2enmod ssl rewrite headers deflate cache http2 proxy_fcgi env expires

Enable and Start the Apache2,

systemctl start apache2

systemctl enable apache2

Database Configuration

Install MySQL database server with Secure installation using the following command,

mysql_secure_installation

Access MySQL database server using the following command,

mysql -u root -p

You will be presented with a series of prompts. Here's what you'll be asked and how to respond:

Set the root password

Set root password? [Y/n] y

Remove anonymous user accounts: Answer "Y" to remove any anonymous MySQL user accounts

Remove anonymous users? [Y/n] y

Disallow root login remotely: Answer "Y" to prevent the root user from logging in remotely

Disallow root login remotely? [Y/n] y

Remove test database and access to it: Answer "Y" to remove the test database and any access to it.

Remove test database and access to it? [Y/n] y

Reload privilege tables now: Answer "Y" to apply the changes you've made

Reload privilege tables now? [Y/n] y

Create a MySQL database for Leantime and set up the necessary database tables,

create database leantime CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

grant all on leantime.* to 'leanuser'@'localhost' identified by 'YOUR_PASSWORD';

flush privileges;

exit

Replace "YOUR_PASSWORD" with a your Secure Strong Password

Download and install Leantime

Download and install the latest version of Leantime, To get the latest version of leantime, you can Click here

When we created the wiki, the latest available version of Leantime was v2.4.4. If a newer version is available at the time of your installation, you will need to replace the download URL and file name in the following command.

cd /var/www

mkdir leantime && cd leantime

wget https://github.com/Leantime/leantime/releases/download/v2.4.4/Leantime-v2.4.4.zip

unzip Leantime-v2.4.4.zip

rm Leantime-v2.4.4.zip

rm -r /var/www/html/*

shopt -s dotglob

cd ..

mv leantime/leantime/* html/

chown -R www-data:www-data /var/www/html

Create a Virtual Host for Leantime,

Create a configuration file for your Leantime installation,

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

Add the following content to the file,

Note: Replace leantime.domainhere.info with your actual domain name

<VirtualHost *:80>
    ServerAdmin admin@leantime.domainhere.info
    ServerName leantime.domainhere.info
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/leantime_error.log
    CustomLog ${APACHE_LOG_DIR}/leantime_access.log combined

    <Directory /var/www/html>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Save the file and exit.

Enable the configuration using the following command,

a2ensite leantime.conf

a2dissite 000-default.conf

systemctl restart apache2

Now open the configuration.php and edit it where necessary including the database part,

cd /var/www/html

mv config/configuration.sample.php config/configuration.php

nano config/configuration.php
   /* Database */
    public $dbHost = 'localhost';                         //Database host
    public $dbUser = 'leanuser';                                  //Database username
    public $dbPassword = 'YOUR_PASSWORD';                              //Database password
    public $dbDatabase = 'leantime';                              //Database name
    public $dbPort = '3306';                              //Database port

Replace "YOUR_PASSWORD" with your set database password.

Install SSL Certificate

To configure SSL, you can use Let's Encrypt and Certbot. Install Certbot for Apache,

snap install certbot --classic

Generate SSL Certificate for the Domain,

certbot --apache -d leantime.domainhere.info

Note: Replace the leantime.domainhere.info with actual domain name

Output:

root@ubuntu23:~# certbot --apache -d leantime.domainhere.info
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for leantime.domainhere.info

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/leantime.domainhere.info/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/leantime.domainhere.info/privkey.pem
This certificate expires on 2024-01-22.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for leantime.domainhere.info to /etc/apache2/sites-available/leantime-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://leantime.domainhere.info
We were unable to subscribe you the EFF mailing list because your e-mail address appears to be invalid. You can try again later by visiting https://act.eff.org.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root@ubuntu23:~#

Access Leantime

To configure Leantime, you need to run the Leantime domain URL in browser.

https://leantime.domainhere.info/install

Replace "leantime.domainhere.info/install" with your actual domainname.

images

Fill the requested details to proceed further with configuration,

images

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

images

Once you login successfully, you will see a dashboard like this.
images


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS