How to install Coppermine on Ubuntu Server

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.

Prerequisites

Step 1: Update the system

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

Step 2: Install Apache web server

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

Step 3: Install PHP

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

Step 4: Install MySQL

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.

Step 5: Create a MySQL database for Coppermine

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;

Step 6: Download and install Coppermine

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/

Step 7: Configure 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.

Step 8: Start Coppermine installation wizard

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/

Step 9: Done!

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!