How to Install PictShare on Debian Latest

This tutorial will guide you through the process of installing PictShare on Debian Latest. PictShare is a self-hosted, open-source image and video sharing platform that allows you to easily share your media files with others.

Prerequisites

Before you begin the installation process, ensure that you have the following:

Step 1: Download PictShare

To download the PictShare package, use the wget command to download the package from the official website:

wget https://www.pictshare.net/download/pictshare_latest.zip

After downloading the package, we need to extract it using the unzip command:

unzip pictshare_latest.zip -d pictshare

Step 2: Configure PictShare

In this step, we need to configure PictShare by editing the pictshare/config.php file. Open the configuration file using your favorite text editor:

nano pictshare/config.php

In the configuration file, find the following lines:

define('URL', 'https://example.com');
define('BASEPATH', '/var/www/html');
define('DATAFOLDER', '/var/www/html/data');
define('INCLUDEPATH', '/var/www/html/include');
define('WATSONUSERNAME', '');
define('WATSONAPIKEY', '');
define('ADMINAPIKEY', 'f3ec779fe2595376ba0e6d45e6baca2c');

Update the following parameters according to your requirements:

Step 3: Create a MySQL Database

In this step, we'll create a MySQL database for PictShare. Log in to your MySQL server using the following command:

mysql -u root -p

Enter your MySQL root password when prompted. Then, create a new database:

CREATE DATABASE pictshare;

Create a new MySQL user and grant it all privileges on the new database:

GRANT ALL PRIVILEGES ON pictshare.* TO 'pictshare_user'@'localhost' IDENTIFIED BY 'pictshare_passwd';

Replace pictshare_user with the desired username, and pictshare_passwd with the desired password.

Flush the privileges and exit the MySQL prompt:

FLUSH PRIVILEGES;
exit

Step 4: Install PictShare

In this step, we'll install PictShare by running the installation script located in the pictshare directory:

cd pictshare
./install.sh

Follow the on-screen instructions to complete the installation process. When prompted, enter the database details you created in Step 3.

Step 5: Configure the Web Server

In this step, we need to configure the web server to serve the PictShare files. If you're using Apache, create a new virtual host configuration file:

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

Add the following configuration to the file:

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/pictshare

    <Directory /var/www/html/pictshare>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/pictshare_error.log
    CustomLog ${APACHE_LOG_DIR}/pictshare_access.log combined

</VirtualHost>

Save and close the file. Then, enable the new virtual host and reload the Apache web server:

a2ensite pictshare.conf
systemctl reload apache2

If you're using Nginx, create a new server block configuration file:

nano /etc/nginx/sites-available/pictshare.conf

Add the following configuration to the file:

server {

    listen 80;

    root /var/www/html/pictshare;
    index index.php;

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

    location ~ \.php$ {
        include fastcgi.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    error_log /var/log/nginx/pictshare_error.log;
    access_log /var/log/nginx/pictshare_access.log;

}

Save and close the file. Then, enable the new server block and reload the Nginx web server:

ln -s /etc/nginx/sites-available/pictshare.conf /etc/nginx/sites-enabled/
systemctl reload nginx

Step 6: Test the Installation

To test if the installation was successful, open your web browser and visit your PictShare installation at http://your-domain.com. If everything is working correctly, you should be able to upload and view images and videos.

Congratulations, you have successfully installed PictShare on Debian Latest!

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!

Alternatively, for the best virtual desktop, try Shells!