Tutorials  /  Ubuntu

How to Install ElefantCMS on Ubuntu 20.04 Server

Ccentron Redaktion · May 2025 ·7 min read ·Ubuntu, Tutorial

ElefantCMS is a free and open-source content management platform that features a user-friendly interface for managing website content effortlessly. Key highlights of this CMS include:

  • Built-in WYSIWYG editor that supports dynamic plugins to enhance features.
  • Native support for multiple languages with integrated language control tools.
  • Streamlined architecture, making it simple for developers to extend core functionalities.
  • Variety of mini-apps to accelerate project development.

This guide walks you through the installation of ElefantCMS on a Ubuntu 20.04 server.

Prerequisites

  • Deploy an Ubuntu 20.04 server and ensure it is fully updated.
  • Create a non-root user with sudo privileges.
VM

Matching infrastructure at centron

Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

1. Install Necessary Software Packages

Update the System’s Package Index

Console
$ sudo apt update

Install PHP 7.4 and Additional Modules

Console
$ sudo apt install apache2 mysql-server php7.4 libapache2-mod-php7.4 php7.4-json php7.4-common php7.4-gmp php7.4-curl php7.4-mysql php7.4-opcache php7.4-intl php7.4-fpm php7.4-xmlrpc php7.4-bcmath php7.4-zip php7.4-imagick php7.4-mbstring php7.4-gd php7.4-cli php7.4-xml php7.4-zip wget curl -y

Modify PHP Configuration Settings

Open the PHP settings file with a text editor:

Console
$ sudo nano /etc/php/7.4/apache2/php.ini

Update the following parameters. To search inside the file, press Control+W, type the keyword, and press Enter:

  • memory_limit = 256M
  • upload_max_filesize = 100M
  • max_execution_time = 360
  • date.timezone = Africa/Nairobi

Enable and Restart Apache Web Server

Enable Apache to run at system boot:

Console
$ sudo systemctl enable apache2

Apply changes by restarting the Apache service:

Console
$ sudo systemctl restart apache2

2. Install ElefantCMS on Ubuntu 20.04

Download the Latest ElefantCMS Release

Fetch the current stable build of ElefantCMS. You can always check for the most recent version by visiting the official download page.

Console
$ wget https://github.com/jbroadway/elefant/archive/elefant_2_2_6_stable.tar.gz

Extract the Compressed Archive

Unpack the contents of the downloaded archive file:

Console
$ sudo tar -xvzf elefant_2_2_6_stable.tar.gz

Rename the Project Directory

Change the extracted folder name to something more descriptive:

Console
$ sudo mv elefant-elefant_2_2_6_stable elefantcms

Move ElefantCMS to the Web Server Root

Relocate the renamed directory into Apache’s default web root:

Console
$ sudo mv elefantcms /var/www/html/

Clean Up the Installation Files

Delete the compressed file now that it's no longer needed:

Console
$ sudo rm elefant_2_2_6_stable.tar.gz

Set File Ownership

Adjust ownership so Apache has proper access to the CMS files:

Console
$ sudo chown -R www-data:www-data /var/www/html/elefantcms

Update Directory Permissions

Grant suitable permissions to the directory and its contents:

Console
$ sudo chmod -R 755 /var/www/html/elefantcms

3. Create the ElefantCMS MySQL Database

Enable MySQL Service on Boot

Make sure the MySQL service is configured to start automatically with the system:

Console
$ sudo systemctl enable mysql

Run MySQL Secure Installation

Execute the built-in security script to harden your MySQL server against potential threats:

Console
$ sudo mysql_secure_installation

Answer the prompts as follows:

  • Set up VALIDATE PASSWORD plugin? Type N and press Enter.
  • Remove anonymous users? Type Y and press Enter.
  • Disallow remote root login? Type Y and press Enter.
  • Delete test database and related access? Type Y and press Enter.
  • Reload privilege tables? Type Y and press Enter.

Access the MySQL Shell

Log into MySQL using the root user. When prompted, enter the password you configured during the secure installation:

Console
$ sudo mysql -u root -p

Create the ElefantCMS Database

Inside the MySQL shell, create a new database named elefant:

Code
CREATE DATABASE elefant;

Create a New MySQL User

Set up a new database user called elefantuser and assign a secure password. Be sure to replace SecurePassword with a strong, unique password:

Code
CREATE USER 'elefantuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'SecurePassword';

Grant Permissions to the New User

Allow the newly created user full control over the elefant database:

Code
GRANT ALL ON elefant.* TO 'elefantuser'@'localhost' WITH GRANT OPTION;

Apply Changes and Exit MySQL

Reload the privilege table to apply the new access rules:

Code
FLUSH PRIVILEGES;

Exit the MySQL environment:

Code
exit;

4. Configure Apache2 for ElefantCMS

Create a Virtual Host File

Set up a new Apache site configuration by creating a dedicated file named elefantcms.conf:

Console
$ sudo nano /etc/apache2/sites-available/elefantcms.conf

Add the following configuration into the file, then save and exit the editor:

Code
<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/elefantcms
    ServerName example.com

    <Directory /var/www/html/elefantcms/>
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Activate Apache Modules and Configuration

Enable the rewrite module, which is necessary for friendly URLs:

Console
$ sudo a2enmod rewrite

Enable the newly created ElefantCMS virtual host configuration:

Console
$ sudo a2ensite elefantcms.conf

Disable the default Apache virtual host configuration to prevent conflicts:

Console
$ sudo a2dissite 000-default.conf

Allow Web Traffic Through Port 80

Permit incoming HTTP traffic via UFW:

Console
$ sudo ufw allow 80

Restart Apache to Apply Changes

Reboot the Apache service so all the modifications take effect:

Console
$ sudo systemctl restart apache2

5. Access the ElefantCMS Installer

To begin setting up ElefantCMS, launch your web browser and navigate to:

http://Server_IP/install/

For example:

http://192.0.2.10/install/

Remove the Installation Directory

Once setup is completed through the browser interface, remove the installer directory for security purposes:

Console
$ sudo rm -r /var/www/html/elefantcms/install

Conclusion

You’ve successfully installed ElefantCMS on your Ubuntu 20.04 server. Proceed by accessing the installation wizard to link your database credentials and set up an administrator account. Once logged in, you're ready to start adding and managing your website content using ElefantCMS’s intuitive interface.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Ubuntu
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren