Neos CMS is a powerful and flexible content management system that offers intuitive editing, comprehensive internationalization, seamless integration with third-party systems, and robust SEO optimization capabilities. In this article, we will guide you through the process of installing and configuring Neos CMS on a Debian 11 server, using the Apache2 web server, MariaDB database server, and PHP 8.1.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- A Debian 11 server with a non-root user and sudo/administrator privileges.
- The UFW firewall enabled.
- A domain name pointed to your Debian server IP address (required for production installations).
Installing Apache2 Web Server
To run Neos CMS, we will use the Apache2 web server. Let’s start by updating and refreshing the Debian repositories:
sudo apt update
Next, install the Apache2 web server:
sudo apt install apache2
After the installation is complete, check the status of the Apache2 service:
sudo systemctl is-enabled apache2
sudo systemctl status apache2
You should see that Apache2 is enabled and running.
Finally, open the HTTP and HTTPS ports on your Debian server:
sudo ufw allow "WWW Full"
sudo ufw status
Make sure the UFW firewall status is active and that the ports and application profiles are listed correctly.
Installing MariaDB Database Server
Neos CMS supports two databases: MariaDB and PostgreSQL. In this guide, we will use MariaDB. Start by installing MariaDB on your Debian server:
sudo apt install mariadb-server
During the installation, you will be prompted to confirm. Press Y
and then ENTER
to proceed.
Once the installation is complete, check the status of the MariaDB service:
sudo systemctl is-enabled mariadb
sudo systemctl status mariadb
You should see that MariaDB is enabled and running.
For security purposes, it is recommended to run the mysql_secure_installation
script to secure your MariaDB installation:
sudo mysql_secure_installation
Follow the prompts to configure the security options for your MariaDB server.
Setting up MariaDB Database and User
After securing your MariaDB installation, we need to create a new database and user specifically for Neos CMS. Log in to the MariaDB shell using the following command:
sudo mysql -u root -p
Enter your MariaDB root password when prompted.
Now, run the following queries to create the Neos CMS database and user:
CREATE DATABASE neosdb; CREATE USER neos@localhost; GRANT ALL PRIVILEGES ON neosdb.* TO neos@localhost IDENTIFIED BY 'Password'; FLUSH PRIVILEGES;
Make sure to replace ‘Password’ with a strong password for the neos@localhost
user.
To verify that the privileges for the neos@localhost
user have been configured correctly, run the following query:
SHOW GRANTS FOR neos@localhost;
If everything is set up properly, you should see the privileges for the neos@localhost
user.
Finally, exit the MariaDB shell:
quit
Installing PHP 8.1 Packages
Neos CMS requires PHP 7.3 or higher. In this guide, we will install PHP 8.1. Start by installing some basic packages for managing third-party repositories:
sudo apt install ca-certificates apt-transport-https software-properties-common wget curl lsb-release
Next, add the PHP 8.x repository to your Debian server:
curl -sSL https://packages.sury.org/php/README.txt | sudo bash -x
This repository provides multiple versions of PHP packages for Debian systems.
Now, install the PHP 8.1 packages and extensions required by Neos CMS:
sudo apt install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-imagick php8.1-mbstring php8.1-curl libapache2-mod-php php8.1-mysql imagemagick
During the installation, you will be prompted to confirm. Press Y
and then ENTER
to proceed.
After the installation is complete, open the php.ini
configuration file:
sudo nano /etc/php/8.1/apache2/php.ini
In this file, locate the date.timezone
parameter and set it to your desired timezone. For example:
date.timezone = America/New_York
Save the file and exit the editor.
Finally, restart the Apache2 service to apply the new PHP configurations:
sudo systemctl restart apache2
Installing Composer
Composer is a package management tool for PHP. We will use Composer to install the PHP dependencies required by Neos CMS. Start by installing Composer on your Debian server:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
This command will download the Composer installer script and run it. Composer will be installed in the /usr/bin
directory.
To verify the Composer installation, run the following command:
sudo -u www-data composer -v
You should see the version of Composer installed on your Debian system.
Installing Neos Base Distribution
With all the necessary components in place, we can now download the Neos CMS source code and install the PHP package dependencies. Start by cloning the Neos CMS repository into the /var/www/neos
directory:
sudo git clone https://github.com/neos/neos-base-distribution.git /var/www/neos
Next, navigate to the /var/www/neos
directory and install the PHP dependencies using Composer:
cd /var/www/neos sudo composer install
Once the installation is complete, set the ownership and permissions of the /var/www/neos
directory to the www-data
user:
sudo ./flow core:setfilepermissions www-data www-data
This ensures that the web server has the necessary access to the Neos CMS files.
Setting up Apache2 Virtual Host
To serve your Neos CMS installation, you need to configure an Apache2 virtual host. If you are using Neos CMS in a production environment, make sure your domain name is pointed to your Debian server IP address and that you have SSL certificates installed.
Enable the required Apache2 modules for SSL and URL rewriting:
sudo a2enmod ssl rewrite
Next, create a new virtual host configuration file for Neos CMS:
sudo nano /etc/apache2/sites-available/neos.conf
Replace the domain name and SSL certificate paths with your own details, and paste the following configuration into the file:
<VirtualHost *:80>
ServerName example.io
ServerAdmin test@example.io
Redirect permanent "/" "https://example.io/"
ErrorLog ${APACHE_LOG_DIR}/example.io.error.log
CustomLog ${APACHE_LOG_DIR}/example.io.access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName example.io
ServerAdmin test@example.io
SetEnv FLOW_CONTEXT Production
DocumentRoot /var/www/neos/Web
ErrorLog ${APACHE_LOG_DIR}/example.io.error.log
CustomLog ${APACHE_LOG_DIR}/example.io.access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.io/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.io/privkey.pem
<Directory /var/www/neos/Web>
AllowOverride All
</Directory>
<Directory /var/www/neos/Web>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
</Directory>
</VirtualHost>
</IfModule>
Save the file and exit the editor.
Activate the virtual host configuration and verify the Apache2 configuration:
sudo a2ensite neos.conf
sudo apachectl configtest
If there are no syntax errors in your Apache2 configuration files, you will see a message indicating that the syntax is OK.
Finally, restart the Apache2 service to apply the new virtual host configuration:
sudo systemctl restart apache2
Configuring Neos CMS Installation
Now that the server-side setup is complete, it’s time to configure Neos CMS through the web interface.
Open your web browser and visit the domain name of your Neos CMS installation (e.g., https://example.io/
).
You will be greeted with the Neos CMS setup page. Click “Go to setup” to begin the configuration process.
On the setup page, enter the setup password. To find the setup password, run the following command on your server:
cat /var/www/neos/Data/SetupPassword.txt
Copy the generated setup password and paste it into the setup page. Click “Login” to proceed.
Next, you will see the Neos CMS requirements check page. Make sure that at least one image manipulation option is installed. Click “Next” to continue.
Provide the database configuration details, including the username, password, and host. Choose the database you created earlier for Neos CMS. Click “Next” to proceed.
Enter the details for the new admin user, including the username, password, first name, and last name. Click “Next” to continue.
For the new Neos site configuration, select the “Neos.Demo” site package and enter the domain name of your Neos CMS installation in the Site Name field. Click “Next” to proceed.
Once the installation and configuration process is complete, you will see a confirmation page. Click “Go to the front end” to view the default home page of your Neos CMS installation. Alternatively, you can click “Go to the backend” to access the Neos CMS administration dashboard.
Congratulations! You have successfully installed and configured Neos CMS on your Debian 11 server. You can now start managing your content and building your website using Neos CMS.
Conclusion
In this comprehensive guide, we have walked you through the process of deploying Neos CMS on a Debian 11 server. We covered the installation of the Apache2 web server, MariaDB database server, and PHP 8.1. Additionally, we installed Composer to manage PHP package dependencies and set up an Apache virtual host for Neos CMS.
Neos CMS offers a powerful and flexible platform for content management, enabling you to create and manage websites seamlessly. With the installation and configuration steps outlined in this guide, you are well-equipped to leverage the features and capabilities of Neos CMS.
For reliable and scalable hosting solutions, consider Shape.host’s Linux SSD VPS services. Their expertise in cloud hosting ensures excellent performance and security for your Neos CMS installation. Shape.host provides efficient and cost-effective solutions for businesses of all sizes. Take advantage of their services to enhance your online presence today.