It is important to understand what you are doing. So to help as I can I will try and explain for you.
Read along to the end as the beginning is already working for you.
Iām old school so I use all the defaults where possible. Apache Web server has been there long before the made nginx and when I see some post from nginx I do not want to get into that. looks way too complicated compared to apache configs.
True I have never touched nginx so I could not judge it on there configs alone maybe there all suplied.
Anyways, There is a admin account on your linux system which is called ā root ā on newer linux systems this user is normally not able to login alone and you grant other users ā sudo ā power to use administrative rights. never the less the user root is still used to drive the system programs and logging.
The MariaDB is easy to setup and every time it is started it will check for insecure access. Hence you will always see
ā[Warning] Access denied for user ārootā@ālocalhostā (using password: NO)ā
in your error.log That is why you need to share as much information about your system/logs when you want help here.
The user root in mariadb is the administrator and after you have secured your mariadb and created a account your pretty much done with that user.
setup mariadb and then create a user that can create a database for your nextcloud instance.
Here is how to setup MariaDB if newly installed and not used for anything other.
sudo apt install mariadb-server
sudo mysql_secure_installation
Answer all Yes with Y and set your root password
Now enter the database command line.
sudo mysql -u root -p
this will open mysql with the user root asking for your password you made with mysql_secure_installation
This user is very powerfull and can destroy everything.
your command line should look like: mysql>
mysql command end with semi-colon ;
tell mysql to use the database mysql
use mysql;
now create a user for your nextcloud db so you do not have to enter the root account in your config.php
create user 'nc_dbuser'@'localhost' identified by 'YourP@s5w0rd';
The username for this account is nc_dbuser you can change it to what you want but for clearity this is the user to connect to the NextCloud DataBase
The localhost after @ tells mysql this user can only connect from the localhost which is your actual computer. no access from outside (WWW) allowed.
this is good for security.
Identified by obviously your own password here
Now we have a user we have to give it permissions what it may do.
grant all privileges on nextcloud.* to 'nc_dbuser'@'localhost';
This one could be better but will set it up no problems as access from outside is not allowed anyways.
grant all means all sql commands allowed now nextcloud.* means only allow it in database nextcloud and the .* means all tables inside nextcoud database.
the last part to again abviously the user to grant it to.
now I donāt know everything but you can use Google too
flush privileges;
quit;
your mariadb is now setup with a database named nextcloud this database can be accessed with username nc_dbuser and password: YourP@s5w0rd
this all seems to be already working fine for you.
Apache or NGINX
here is my apache command for setting up
apt install apache2 libapache2-mod-php libapache2-mod-php7.4 python3-certbot-apache certbot ssl-cert openssl php7.4 php-memcache php-imagick imagemagick php-apcu php-redis php7.4-{bcmath,bz2,curl,gd,gmp,imap,intl,json,mbstring,mysql,opcache,pspell,readline,soap,tidy,xml,xmlrpc,zip}
sudo mkdir -p /var/www/nextcloud
sudo chown www-data:www-data /var/www/nextcloud/
cd /var/www/
sudo wget -O nc.tar.bz2 https://download.nextcloud.com/server/releases/nextcloud-19.0.2.tar.bz2
sudo -u www-data tar xjfp nc.tar.bz2
sudo a2ensite default-ssl.conf
sudo certbot run --apache -d cloud.usee.ga,www.usee.ga,usee.ga
sudo systemctl restart apache2
<VirtualHost *:80>
Redirect permanent / https://cloud.usee.ga/
ServerName usee.ga
DocumentRoot /var/www/nextcloud
ServerAlias www.usee.ga cloud.usee.ga
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/nextcloud
ServerName usee.ga
ServerAlias www.usee.ga cloud.usee.ga
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
<Directory /var/www/nextcloud>
Options +FollowSymlinks
AllowOverride All
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/cloud.usee.ga/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/cloud.usee.ga/privkey.pem
</VirtualHost>
</IfModule>
Above is Apache site config
your NGINX may be pointing to /var/www/html/ or /var/www as webserver home I donāt know how you installed Nextcloud. some script or manually.
Maybe there are some missing modules please supply more info. no need to share sensitive information.
root user has nothing to do with nextcloud.
nc_dbuser is only to connect to your database. itās login is stored in nextcloud/config/config.php
when browsing to your installation IP/DOMAIN you will create a new user for your nextcloud which will be the first user and will have admin rights for your nextcloud instance.
I hope this is of any help understanding users