How to Install Chibisafe on Elementary OS Latest

Chibisafe is a file hosting software that allows users to upload and share files online. Here is a step-by-step tutorial on how to install Chibisafe on Elementary OS Latest.

Step 1. Install Required Dependencies

Before you install Chibisafe, you need to make sure that all the necessary dependencies are installed on your system. Open the terminal and run the following command to install the required software packages:

sudo apt-get update
sudo apt-get install curl gnupg2 nginx php7.4-fpm php7.4-cli php7.4-mysql php7.4-gd php7.4-imagick php7.4-curl php7.4-intl php-pear php7.4-dev php7.4-zip php7.4-mbstring php7.4-xml unzip

Step 2. Install Database Management System

Chibisafe requires a database management system to store user data. For this tutorial, we will use MariaDB. Run the following command to install MariaDB:

sudo apt-get install mariadb-server mariadb-client

After installation, run the command below to secure the MariaDB installation:

sudo mysql_secure_installation

Step 3. Create Database and User

Next, we need to create a new database and user for Chibisafe. Connect to the MariaDB server by running:

sudo mysql

Then, run the following SQL commands to create a new database and user:

CREATE DATABASE chibisafe;
CREATE USER 'chibisafeuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON chibisafe.* TO 'chibisafeuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Replace password with a strong password you want to use for the user.

Step 4. Install Chibisafe

You can download the latest Chibisafe release from the official website using curl. Run the command below to download the file:

curl -L https://github.com/Kurumiim/Chibisafe/releases/download/v2.1.0/chibisafe-v2.1.0.zip -O

Then, extract the downloaded file using the command below:

unzip chibisafe-v2.1.0.zip

Next, move the extracted files to the /var/www/ directory using the command below:

sudo mv chibisafe /var/www/

Step 5. Configure Nginx

We need to configure Nginx to serve Chibisafe. Create a new configuration file for Chibisafe by running:

sudo nano /etc/nginx/sites-available/chibisafe

Then, paste the following configuration code into the file:

server {
    listen 80;
    root /var/www/chibisafe/public;
    index index.php;
    server_name your_domain.com; ## Change this to your domain name

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

Make sure to replace your_domain.com with your domain name or IP address. This configuration file tells Nginx to serve Chibisafe on port 80, using PHP-FPM to execute PHP code.

Then, save and close the file by pressing CTRL+X, then Y, and hit ENTER.

Next, create a symbolic link to enable the Chibisafe configuration file by running:

sudo ln -s /etc/nginx/sites-available/chibisafe /etc/nginx/sites-enabled/

Finally, test the Nginx configuration and restart the service by running:

sudo nginx -t
sudo systemctl restart nginx

Step 6. Configure Chibisafe

We need to configure Chibisafe to connect to the database and enable uploads. Open the configuration file by running:

sudo nano /var/www/chibisafe/.env

Then, replace the MySQL configuration lines with the following:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=chibisafe
DB_USERNAME=chibisafeuser
DB_PASSWORD=password

Make sure to replace password with the password you used for the database user.

Then, scroll down to the Filesystem section, and replace the driver with public:

FILESYSTEM_DRIVER=public

Save and close the file by pressing CTRL+X, then Y, and hit ENTER.

Step 7. Enable HTTPS (Optional)

It is recommended to secure your Chibisafe installation by enabling HTTPS. You can do so by obtaining a free TLS/SSL certificate from Let's Encrypt using Certbot. Run the following command to install Certbot:

sudo apt-get install certbot python3-certbot-nginx

Then, run the command below to obtain a certificate:

sudo certbot --nginx -d your_domain.com

Make sure to replace your_domain.com with your domain name or IP address.

Step 8. Access Chibisafe

You can now access your Chibisafe installation by visiting http://your_domain.com or http://your_ip_address in your web browser. You should see the Chibisafe homepage, where you can upload and share files.

If you enabled HTTPS in the previous step, access Chibisafe by visiting https://your_domain.com or https://your_ip_address.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!