How to Install PicoShare on Ubuntu Server Latest
PicoShare is a self-hosted file sharing platform that allows you to easily share files with other users. In this tutorial, we will guide you through the process of installing PicoShare on Ubuntu Server Latest using a few easy steps.
Prerequisites
Before we start with the installation, make sure that you have the following prerequisites installed on your Ubuntu Server:
- Ubuntu Server Latest version
- SSH Access to your Ubuntu Server
- Root privileges or an account with sudo access
Step 1: Update Ubuntu Server
First, we need to make sure that Ubuntu Server is up to date by running the following commands:
sudo apt update
sudo apt upgrade
Step 2: Install Required Dependencies
Now, we will install the required dependencies for PicoShare to work:
sudo apt install -y curl nginx mariadb-server php-fpm php-mysql unzip
Step 3: Set Up the Database
Next, we will create a new database using MariaDB for PicoShare:
sudo mysql -u root -p
Enter your MariaDB root password when prompted, and then run the following commands to create a new database, user, and grant permissions:
CREATE DATABASE picoshare;
CREATE USER 'picoshare'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON picoshare.* TO 'picoshare'@'localhost';
FLUSH PRIVILEGES;
QUIT;
Make sure to replace password with a strong password of your choice.
Step 4: Download and Install PicoShare
Download the latest version of PicoShare on your Ubuntu Server:
curl -o picoshare.zip https://downloads.pico.rocks/latest.zip
unzip picoshare.zip
sudo mv picoshare/* /var/www/html/
sudo chown -R www-data: /var/www/html/
Step 5: Configure NGINX
Now, we need to configure the NGINX web server to serve PicoShare. Create a new NGINX configuration file for PicoShare:
sudo nano /etc/nginx/sites-available/picoshare
Add the following configuration:
server {
listen 80;
server_name example.com;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
Make sure to replace example.com with your domain name or IP address.
Save the file, and then create a symbolic link to enable the configuration:
sudo ln -s /etc/nginx/sites-available/picoshare /etc/nginx/sites-enabled/picoshare
Finally, restart NGINX to apply the changes:
sudo systemctl restart nginx
Step 6: Configure PicoShare
Next, we will configure PicoShare by editing the config.php file:
sudo nano /var/www/html/config.php
Change the following settings:
DB_USER: Set this topicoshare.DB_PASSWORD: Set this to the password you chose for thepicoshareMariaDB user in Step 3.UPLOAD_DIR: Set this to the absolute path of the directory where you want uploaded files to be stored. For example,/var/www/html/uploads.PICO_URL: Set this to the URL where you will access PicoShare. For example,http://example.com.
Save the file, and then restart NGINX again:
sudo systemctl restart nginx
Final Step: Access PicoShare
Now that PicoShare is installed and configured, you can access it by going to the URL you set in PICO_URL. You can create an account, upload files, and share them with others. Congratulations, you have successfully installed PicoShare!