How to Install Plik from Github on Ubuntu Server

Plik is an open-source file sharing platform that allows users to upload and share files securely. It is easy to use and has a user-friendly interface. In this tutorial, we will guide you through the process of installing Plik on Ubuntu Server using Github.

Prerequisites

  • Ubuntu Server latest version.
  • A user account with sudo privileges.

Step 1 – Installing Required Packages

Let's start by updating the package index and installing required packages. Open the Terminal, and execute the following commands:

sudo apt-get update -y
sudo apt-get install -y git apache2 php libapache2-mod-php php-common php-mbstring php-zip php-xml php-mysql php-gd php-curl

Step 2 – Clone Plik from Github

Once the packages are installed, the next step is to clone the Plik repository from Github. Execute the following command to clone the repository:

git clone https://github.com/root-gg/plik.git

Step 3 – Move Plik Directory to Apache2 Root Directory

After cloning, move the Plik directory to the Apache2 root directory. Use the following command:

sudo mv plik /var/www/html/

Step 4 – Configure Apache2

To configure Apache2 for Plik, create a new site configuration file by running the command:

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

And add the following content to the file.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/plik
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html/plik>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

To save and exit the file, hit Ctrl + X, Y, and Enter.

Then, Enable the new site using the following command:

sudo a2ensite plik.conf
sudo a2enmod rewrite

And finally, restart Apache2 using the following command:

sudo systemctl restart apache2

Step 5 – Configure Plik

To configure Plik, edit the config.php file located at /var/www/html/plik/app/config/config.php.

sudo nano /var/www/html/plik/app/config/config.php

Edit the following lines and set the correct values:

$config['base_url'] = 'http://your_domain_or_IP_address/';
$config['db']['host'] = 'localhost';
$config['db']['user'] = 'plik';
$config['db']['password'] = 'your_plik_database_password';

Save and exit the file using the same steps as in Step 4.

Step 6 – Create MySQL Database for Plik

Finally, create a MySQL database and user for Plik using the following commands:

sudo mysql -u root -p

#Create database and user 
> CREATE DATABASE plik CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
> CREATE USER 'plik'@'localhost' IDENTIFIED BY 'your_plik_database_password';
> GRANT ALL ON plik.* TO 'plik'@'localhost';
> FLUSH PRIVILEGES;

# Exit MySQL
> exit

Conclusion

Plik from Github has been successfully installed on Ubuntu Server, Congratulations! You can now access your Plik file sharing platform using your domain name or IP address.