Coppermine is a free and open-source photo gallery script that allows users to easily create and manage their own photo galleries online. In this tutorial, we will go through the steps of installing Coppermine on Debian Latest.
Before beginning the installation process, you must make sure that your Debian Latest system is up to date and that you have root privileges.
First, we need to install some of the required dependencies for Coppermine. Run the following command:
# sudo apt-get install apache2 mariadb-server mariadb-client imagemagick php php-mysql php-xml php-gd php-mbstring php-zip
This command will install the Apache web server, the MySQL/MariaDB database server, ImageMagick, and a few PHP extensions required by Coppermine.
Now that we have installed the required dependencies, we can download the Coppermine package from the official website using the following command:
# wget https://github.com/coppermine-gallery/coppermine/archive/1.6.X.tar.gz
This command will download the latest stable release of Coppermine.
Once the Coppermine package has been downloaded, we need to extract it and move it to the Apache web root directory. Run the following commands:
# tar xvfz 1.6.X.tar.gz
# mv coppermine-1.6.X/ /var/www/html/coppermine
These commands will extract the package and move the extracted directory to the Apache web root directory.
Now that the Coppermine files are in the web root directory, we need to configure Coppermine to work with our Apache server and MariaDB database.
First, we need to create a new database and user for Coppermine to use. Run the following MySQL/MariaDB commands:
# mysql -u root -p
This command will prompt you for the MySQL/MariaDB root password. Once you've entered the password, you can create a new database by running the following command:
CREATE DATABASE coppermine;
This will create a new database called "coppermine".
Next, we need to create a new user and grant them privileges to the "coppermine" database. Run the following commands:
CREATE USER 'cpguser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON coppermine.* TO 'cpguser'@'localhost';
FLUSH PRIVILEGES;
Replace "password" with a secure password of your choice.
Next, we need to configure Coppermine to use our new MariaDB database. Copy the "include/config.inc.php.sample" file to "include/config.inc.php" and edit it using the following command:
# cd /var/www/html/coppermine/include
# cp config.inc.php.sample config.inc.php
# nano config.inc.php
Change the following lines:
$CONFIG['dbserver'] = 'localhost'; // database server (usually 'localhost')
$CONFIG['dbname'] = 'coppermine'; // name of Coppermine's database
$CONFIG['dbuser'] = 'cpguser'; // user Coppermine will connect with
$CONFIG['dbpass'] = 'password'; // password user will use to connect
Replace "password" with the password you set for the "cpguser" MySQL/MariaDB user.
Coppermine requires write permissions to certain directories in order to function correctly. Run the following commands to set the necessary permissions:
# chown -R www-data:www-data /var/www/html/coppermine
# chmod -R 755 /var/www/html/coppermine
# chmod 777 /var/www/html/coppermine/albums/
These commands will set the correct ownership and file permissions to the Coppermine directory.
At this point, Coppermine has been successfully installed and configured on your Debian Latest system. You can access it by visiting http://your_server_IP_address/coppermine/ in your web browser.
Congratulations! You've installed Coppermine 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!