Installing Drupal on NethServer

To be honest, I was afraid to install anything outside software center. For me it was like… out of the question… I was afraid… and still I am. But I guess I have to risk!

1 Like

You must be careful to anything which can be in conflict with what NS has already installed as a part of NS (Apache, MariaDB, …). This is also the “short story” but you can try.
The best way is to try first on VM. But even here, there are some issues that could appear, usually not from NS but how the VM is connected to outside.


The most important thing: do not test anything on a production server!

Drupal will not end up as something that you can manage through the NethServer interface. But installing Drupal is easy enough to do it over the commandline.
Creating a database for Drupal on NethServer is the same as on any other distribution. You can have a look at my Moodle installation howto in this forum: the part of creating a database and database user is the same: (change moodle for drupal)
Prerequisites are that you have the database module and the webserver module installed.


Create a mysql database and user for MoodleDrupal

The password for mariadb root account is stored in /var/lib/nethserver/secrets/mysql.

cat /var/lib/nethserver/secrets/mysql

Copy the password.
Now open a mysql prompt:
mysql -u root -p
Fill in the copied password and you will be in the Mariadb prompt:
MariaDB [(none)]>
Remember, every command you give in the Mariadb prompt must end with a ;

MariaDB [(none)]> create database moodledrupal;
MariaDB [(none)]> create user ‘moodledrupal’@‘localhost’ identified by ‘chooseyourdrupalpassword’;
MariaDB [(none)]> grant all privileges on moodledrupal.* to ‘moodledrupal’@‘localhost’;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit



have checked out the command “mysql” of a ssh-console? It is usually installed with every MySQL server.

regards mario


You are a great community… i think the best i have ever seen…
On the other hand… i will give developers some suggestions that they could consider for future versions of nethserver (i hope this won’t sound bad because this is not my intention)…
It would be great if you could make a menu with databases and users for those databases (that would make nethserver more user friendly and would reduce the risk of doing something wrong).
It would be great to create a menu for different php versions (so you can choose any php version for every site you host on your server).

Thank you all for your suggestions and for your time you lost with me!!

done by nethserver-phpscl, yet only for ns6

I would in the future base all my work on php-fpm and get rid of php-mod

it exists also for ns6 and ns7, install nethserver-phpmyadmin, it is the purpose of this software.

all relative documentation to install external modules are there

May I suggest that you install first nethserver-shellinabox, you will have a terminal in your web browser where you can copy and paste command like in your terminal.

Welcome on board @liviu


Hi @liviu,
Thanks for your suggestions. It is great to hear what people drive and what they seek in a (Neth)Server distribution. Making it the sysadmin’s life easier is always a trade-off between flexibility and ease-of-use.
Although I do appreciate the suggestions you posted, I also want to point to the need of knowing what you are doing. A point and click system most of the time doesn’t help with that deeper knowledge. Diving into the commandline does, although it also is a steep learning curve. But remember, for each part you want to accomplish, you can find a how-to. Like in the create database and user in MySQL/MariaDB example.
I wrote the how-to install Moodle on NethServer. Even though I can find my way now on the commandline, I come from a Microsoft environment, so commandline was completely new to me a few years ago.
I can only say: you will learn the fastest by doing.
So my suggestion would be: dive into the commandline and when you can find your way, feel free to use the handy point and click tools that come with NethServer.
You might want to create a howto install Drupal on NethServer. If you want to document your Drupal install, please do so. And if you run into anything, just yell. I have installed Drupal several times on Ubuntu, and know that installing Drupal is very similar to installing Moodle. Feel free to use the Moodle install howto as an example.

1 Like

I’m back again with questions…

First of all… thank you for the support.
So I installed phpmyadmin… but i have another problem logging to mysql… phpmyadmin returns “Cannot log in to the MySQL server” and i’m getting the same problem in terminal “acces denied for user root@localhost”… i think mysql doesn’t recognise root as user… is there something i missed somewhere?

Stephane, i followed your tutorial on installing phpmyadmin for nethserver 7. Everything went almost fine. And i say almost because there is no /etc/my.pwd but i think it is /etc/my.cnf which doesn’t have in it any admin password.

sorry I will modify the documentation, the path is /root/.my.cnf

cat /root/.my.cnf

Great. It’s working now! Thank you!!!

after you can change IN phpMyAdmin the password of the user admin by something more easy…of course 123456 is not advised

First thing i did was change the password… And i used a bit more complex password than 123456 :smile: I can only hope to remember the new password :smile:

But still i was wondering why i couldn’t log in with root and the same password i use for my server. I saw that root is listed as user so it should work, i think.

simply do in your root terminal ‘mysql’

It’s working in terminal…

so you can’t login in phpmyadmin with root… root is used only in terminal…

Thank you, Stephane!!

1 Like

Thanks man, we try to do as much as we can :slight_smile:

when you put people first, magic things happen :rainbow:

As @robb has already suggested, generally we choose another way, we use shell to configure properly the system writing here some notes. Then someone ( @dev_team ) build a package to wrap up anything.
I’d like to see an howto and then a package for Drupal. It would be awesome!
Would you mind keeping us updated ?

I’d go with the great phpmyadmin module built by Stéphane.

Otherwise, you could user adminer (all these steps are required only in a machine without mysql installed):

yum install nethserver-mysql php-mysql -y
systemctl restart httpd
wget -O /var/www/html/adminer.php -q
echo "MySQL root password: " `cat /var/lib/nethserver/secrets/mysql`

Access you server: http://server_ip/adminer.php

Enjoy :wink:

1 Like

Hi guys,

I managed to install phpmyadmin. @stephdl helped me alot and i thank him for that. Unfortunately i have another problem with drupal. The php version in nethserver is too old (it should be at least 5.3.9). I know @stephdl is working to make possible installing multiple php versions on nethserver7 (i’d go with php 7 +).

I dont understand, with ns7 the php version is 5.4…it should be good

Sorry… a type mistake… it’s 5.5.9…it’s too early for me :smile:
Look at the message “Your PHP installation is too old. Drupal requires at least PHP 5.5.9. See the system requirements page for more information.”

1 Like

So you need SCL with version 5.6, @stephdl is your man :slight_smile: