Neos is a free and open-source content management system with intuitive editing, complete internationalization, maximum flexibility, and ease of integration with 3rd party systems.

Neos is an enterprise content management built-in with custom content modeling that provides an effective way to edit and manage content, SEO optimization such as automatic redirects and SEO metadata, and powerful roles and user management.

In this guide, we will walk you through the installation of Neos CMS on the Ubuntu 24.04 server. You will install Neos CMS with the LAMP Stack, Composer, and ImageMagick. You will be utilizing the flow Utility for installing and managing Neos CMS.

Prerequisites

To start with this guide, make sure you have:

  • An Ubuntu 24.04 server.
  • A non-root user with administrator privileges.
  • A domain name pointed to your server IP address.

Installing Dependencies

Before installing Neos CMS, you need to install dependencies such as LAMP Stack (Linux, Apache, MySQL/MariaDB, and PHP), Composer, Git, and ImageMagick. Those packages are available by default on the Ubuntu repository, and you can install them through APT.

First, update your Ubuntu package index with the following command:

sudo apt update

Now install dependencies for Neos CMS with the command below. In the following, you will be installing LAMP Stack (Linux, Apache, MySQL/MariaDB, and PHP), Composer, Git, and ImageMagick packages.

sudo apt install apache2 mariadb-server composer git php php-cli php-common php-imap php-redis php-snmp php-xml php-zip php-imagick php-mbstring php-curl libapache2-mod-php php-mysql imagemagick

Input Y to confirm the installation.

<img alt="install deps" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/1-install-deps.png66695379c1160.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="140" loading="lazy" src="data:image/svg xml,” width=”750″>

After the installation, check the status of Apache and MariaDB services to ensure it is running.

Check the Apache web server with the following. You will see that the service is enabled and active(running).

sudo systemctl is-enabled apache2

sudo systemctl status apache2

<img alt="check apache2" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/2-check-apache2.png6669537a012e3.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="215" loading="lazy" src="data:image/svg xml,” width=”750″>

Now check the MariaDB service status with the following – You will see a similar output. The MariaDB is enabled and active(running).

sudo systemctl is-enabled mariadb

sudo systemctl status mariadb

<img alt="check mariadb" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/3-check-mariadb.png6669537a3330a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="237" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, check the PHP and Composer versions using the command below. PP 8.3 and Composer 2.7 are installed on your Ubuntu system.

php -v

sudo -u www-data composer -v

<img alt="check php and composer" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/4-check-composer-php-version.png6669537a647a9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="226" loading="lazy" src="data:image/svg xml,” width=”693″>

Configuring PHP

After installing dependencies, you will set up PHP installation by editing the php.ini file and then restart the Apache web server.

Open the PHP config file /etc/php/8.3/apache2/php.ini with the following nano editor command.

sudo nano /etc/php/8.3/apache2/php.ini

Change the default configuration with the following. Make sure to adjust both date.timezone and memory_limit with your server settings.

date.timezone = Europe/Amsterdam

upload_max_filesize = 80M

memory_limit = 512M

max_execution_time = 360

When finished, save the file and exit the editor.

Now run the command below to restart the Apache web server and apply your PHP configuration.

sudo systemctl restart apache2

Configuring MariaDB server

In this section, you will be securing your MariaDB server installation and creating a new database and user for Neos CMS. You will utilize the mariadb-secure-installation to secure MariaDB, then you will access the MariaDB server through the mariadb client.

To secure MariaDB server installation, run the mariadb-secure-installation command below.

sudo mariadb-secure-installation

Now you will be prompted with MariaDB server configurations:

  • For the default MariaDB server installation without a root password, press ENTER when asked about the password.
  • The local authentication for MariaDB root users is secured by default, input ‘n’ when asked to change the authentication method to ‘unix_socket’.
  • Input ‘Y’ to create a new MariaDB root password. Then, input the strong password for your MariaDB root user and repeat.
  • When asked to disable remote authentication for the MariaDB root user, input ‘Y’ to agree.
  • The default MariaDB server installation comes with the database ‘test’ and allows an anonymous user to access it.
  • Input ‘Y’ for both settings to remove the default database ‘test’ and remove the anonymous privilege.
  • Lastly, input ‘Y’ to confirm reloading table privileges.

After you have secured MariaDB, you will create a new database and user through the mariadb client utility.

Run the command below to log in to the MariaDB server. Enter your MariaDB root password when asked.

sudo mariadb -u root -p

Now run the following queries to create a new database and user for Neos CMS. In this example, you will create a new database neosdb, a user neos with the password neospassword. You can adjust that information with yours.

CREATE DATABASE neosdb;

CREATE USER neos@localhost IDENTIFIED BY ‘neospassword’;

GRANT ALL PRIVILEGES ON neosdb.* TO neos@localhost IDENTIFIED BY ‘neospassword’;

FLUSH PRIVILEGES;

<img alt="create database and user" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/5-create-database.png6669537a9613b.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="212" loading="lazy" src="data:image/svg xml,” width=”750″>

Next, run the query below to check privileges for the user neos. Make sure that the user neos can access the database neosdb.

SHOW GRANTS FOR neos@localhost;

Lastly, type quit to exit from the MariaDB server.

<img alt="check user privileges" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/6-show-user-privileges.png6669537ac8d56.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="292" loading="lazy" src="data:image/svg xml,” width=”729″>

Downloading Neos CMS Source Code

Now that you have configured both PHP and MariaDB, you will be downloading Neos CMS source code and installing PHP dependencies with the Composer. You will also set up the Neos CMS installation with proper permission and ownership.

First, run the git command below to download the Neos CMS source code to the /var/www/neos directory.

git clone https://github.com/neos/neos-base-distribution.git /var/www/neos

Move to the /var/www/neos directory and install Neos CMS dependencies with the composer command below.

cd /var/www/neos

composer install

As for now, enter yes to confirm and run Composer as root.

<img alt="install php dependencies with composer" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/7-install-deps.png6669537ae9b39.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="283" loading="lazy" src="data:image/svg xml,” width=”750″>

After the process is complete, run the command below to change the permission of Neos CMS source code to the www-data user.

sudo ./flow core:setfilepermissions www-data www-data

sudo chown -R www-data:www-data /var/www/neos

Setting up Apache virtual host

In this section, you will be creating a new Apache virtual host for running Neos CMS. So make sure that you have your domain name pointed to server IP address. You can use the public domain or local domain for development.

Enable the rewrite and ssl modules for Apache with the command below.

sudo a2enmod rewrite ssl

<img alt="enable rewrite and ssl module" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/8-setup-apache.png6669537b22bf4.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="280" loading="lazy" src="data:image/svg xml,” width=”563″>

Now create a new Apache virtual host file /etc/apache2/sites-available/neos.conf with the following nano editor.

sudo nano /etc/apache2/sites-available/neos.conf

Insert the configuration into the file and input your domain name to the ServerName option.

ServerName hwdomain.io

ServerAdmin [email protected]

ErrorLog ${APACHE_LOG_DIR}/hwdomain.io.error.log

CustomLog ${APACHE_LOG_DIR}/hwdomain.io.access.log combined

#SetEnv FLOW_CONTEXT Production

DocumentRoot /var/www/neos/Web

# Add security

php_flag register_globals off



AllowOverride All



RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*) index.php [PT,L]

When finished, save and exit the file.

Next, run the command below to activate the virtual host file neos.conf and verify your Apache syntax. If you have correct and proper Apache syntax, you will get an output Syntax is OK.

sudo a2ensite neos.conf

sudo apachectl configtest

Lastly, run the following to restart the Apache web server and apply your changes. Once restarted, your Neos CMS should be ready.

sudo systemctl restart apache2

<img alt="setup apache vhost" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/9-setup-apache2.png6669537b419b5.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="344" loading="lazy" src="data:image/svg xml,” width=”718″>

Securing Neos CMS with HTTPS

In this guide, you will run Neos CMS with HTTPS through Certbot and Letsencrypt. This is only possible if you’re installing Neos CMS on the public domain name. If you’re using a local domain, you can generate SSL certificates with OpenSSL and configure HTTPS manually.

Install the Certbot and Certbot Apache plugin with the following command. Type Y to confirm the installation.

sudo apt install certbot python3-certbot-apache2

Now run the certbot command below to generate SSL/TLS certificates for Neos CMS. Make sure to change the email address and domain name with your information.

sudo certbot –apache –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d hwdomain.io

After the process is finished, your SSL certificates will be available in the /etc/letsencrypt/live/domain.com directory. And your Neos CMS should be secured automatically with HTTPS.

Installing NEOS CMS from the command line

Now that you have downloaded the Neos CMS source code and configured the Apache virtual host, you will start the Neos CMS installation through the terminal. With the flow utility, you can manage and install Neos CMS from your terminal.

Go to the /var/www/neos directory with the following:

cd /var/www/neos

Run the command below to set up a database for Neos CMS. Select mysqli as the database driver and enter your details MariaDB database and user that you’ve created.

sudo ./flow setup:database

When successful, you will see an output such as Database neosdb was connected successfully.

<img alt="setup database" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/10-setup-database.png6669537b65f57.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="380" loading="lazy" src="data:image/svg xml,” width=”533″>

Now run the command below to set up the default image handler for Neos CMS and select Imagick.

sudo ./flow setup:imagehandler

<img alt="setup image handler" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/11-imagehandler.png6669537b8a45a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="231" loading="lazy" src="data:image/svg xml,” width=”583″>

After configuring the database and image handler, run the command below to migrate the Neos CMS database.

sudo ./flow doctrine:migrate

You can see the following output during database migration.

<img alt="migrate database" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/12-migrate-database.png6669537bc45bc.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="277" loading="lazy" src="data:image/svg xml,” width=”750″>

Next, run the following to create an administrator user for your Neos CMS installation. Enter your username, email address, first name, last name, and your password.

sudo ./flow user:create –roles administrator

You will get an output like the following:

<img alt="setup admin" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/13-setup-user.png6669537c0995a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="165" loading="lazy" src="data:image/svg xml,” width=”750″>

Now run the command below to import the Neos.Demo site to your installation. if successful, you will get an output Import of site "Neos Demo site" finished.

sudo flow:cache:flush

sudo ./flow site:import –package-key Neos.Demo

<img alt="import demo site" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/14-import-demo-site.png6669537c3aedf.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="183" loading="lazy" src="data:image/svg xml,” width=”750″>

With this, the Neos CMS is complete. Visit your domain name such as https://hwdomain.io and you will get the Neos CMS home page like the following:

<img alt="homepage" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/15-homepage.png6669537c5f4a0.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="305" loading="lazy" src="data:image/svg xml,” width=”750″>

To access the Neos CMS login page, visit https://hwdomain.io/login and input your admin user and password that you’ve created. Click Login to confirm.

<img alt="login neos cms" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/16-login.png6669537c9ca13.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="591" loading="lazy" src="data:image/svg xml,” width=”507″>

If you have proper admin credentials, you will see the Neos CMS dashboard like the following:

<img alt="dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/06/echo/dashboard.png6669537cdd822.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="390" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! You have completed the Neos CMS installation on an Ubuntu 24.04 server. You have Neos CMS running with the LAMP Stack (Linux, Apache, MySQL/MariaDB, and PHP) and secured with HTTPS through Let’s Encrypt. You have also learned the basic command flow for installing and managing Neos CMS.