Coppermine is a free, open-source photo gallery software that allows users to create and manage their own photo gallery websites. In this tutorial, we will guide you on how to install Coppermine on Ubuntu Server.
Before installing any software, it is recommended to update the system to its latest version. Run the following command to update the system:
sudo apt-get update && sudo apt-get upgrade -y
Coppermine requires a web server to function correctly. Apache is the most common web server used around the world. Install Apache web server by running the following command:
sudo apt-get install apache2 -y
Coppermine requires PHP version 5.6.0 or higher. Install PHP by running the following command:
sudo apt-get install php libapache2-mod-php php-mysql -y
Once the installation is complete, restart the Apache webserver by running the following command:
sudo systemctl restart apache2
Coppermine requires a database to store information. Install MySQL by running the following command:
sudo apt-get install mysql-server -y
During the installation, you will be prompted to set a root password for MySQL. Remember this password as you will need it later.
After installing MySQL, log in to the MySQL database server using the following command:
mysql -u root -p
Enter the root password you set during installation when prompted.
Create a new database for Coppermine using the following command:
CREATE DATABASE coppermine;
Create a new MySQL user and grant access to the Coppermine database using the following command:
GRANT ALL PRIVILEGES ON coppermine.* TO 'coppermineuser'@'localhost' IDENTIFIED BY 'password';
Replace "password" with a strong password of your choice. Remember this password as well.
Exit the MySQL prompt by running the following command:
QUIT;
Download the latest Coppermine version from the official website using the following command:
wget -c https://netix.dl.sourceforge.net/project/coppermine/coppermine/1.6.x/coppermine-1.6.08.tar.gz
Extract the downloaded package using the following command:
tar -xzvf coppermine-1.6.08.tar.gz
Move the extracted files to the Apache root directory by running the following command:
sudo mv coppermine /var/www/html/
Change the ownership of the Coppermine files to the Apache user using the following command:
sudo chown -R www-data:www-data /var/www/html/coppermine/
Go to the Coppermine installation directory by running the following command:
cd /var/www/html/coppermine/
Rename the "include/config.inc.php.sample" file to "include/config.inc.php" by running the following command:
mv include/config.inc.php.sample include/config.inc.php
Change the permissions of the configuration file using the following command:
chmod 666 include/config.inc.php
Open the "include/config.inc.php" file in a text editor and update the following information:
$CONFIG['dbuser'] = 'coppermineuser'; // MySQL username
$CONFIG['dbpass'] = 'password'; // MySQL password
$CONFIG['dbname'] = 'coppermine'; // Coppermine database name
$CONFIG['dbserver'] = 'localhost'; // MySQL server address
Replace "coppermineuser" and "password" with the MySQL username and password you created earlier.
Save and close the file.
Open your web browser and enter your server's IP address or hostname followed by "/coppermine". The Coppermine installation wizard will start automatically. Follow the on-screen instructions to complete the installation.
After the installation is complete, remove the installation directory for security purposes by running the following command:
sudo rm -R /var/www/html/coppermine/install/
Congratulations! You have successfully installed Coppermine on your Ubuntu Server. You can now start using Coppermine to manage and share your photo galleries.
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!