Howto Install NextCloud 20 on Ubuntu 20.04.1 The classic way [Wiki]

This is how it looks for me, what I can see I’m missing the data folder. And I also have a empty file ”CAN INSTALL” in the config folder…

bild

Is it possible you have not ran the installation in the webbrowser. Maybe it needs to be done before you edit the file

So first startup the installation of Nextcloud in your browser:

yourserverip/nextcloud

Do the rest of the configuration in the web browser. Enter the username and password for the administrator. Enter the username and password for the database user. Put the data directory: /media/d1/nextcloud

and than try editing the file /var/www/nextcloud/config/config.php
please let me know and I will adjust the instructions.

Ok, after a little bit further investigation this is what I got up to:
It seems like the config.php does not exist before you have made the setup through the webbrowser. I probably created the config.php file myself.

Although, I cant access the nextcloud installation. Its only saying “The requested URL was not found on this server.”
Apache web server is running, and I can reach the default apache url with myip.

But… shouldn’t the nextcloud directory be in the /var/www/html location?

Can see the apache page? Can you see the PHP info page. If not you will be able to see the nextcloud install.

Yes, this is working…

image

And this is what I get when I add /nextcloud to the url…

image

Just downloaded the latest install from Nextcloud and looked at it. You are right there is no /var/www/nextcloud/config/config.php file before you have done the web based install. I will change my wiki so that it reflects this. Thanks for letting me know.

Hi @NextCees

Just FYI:

There is also the possibility to do this via the command line with the occ maintenance:install command.

Example:

sudo -u www-data php /var/www/html/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "nextcloud" --database-pass "nc_db_password" --admin-user "Nextcloud-Admin" --admin-pass "admin-password" --data-dir "/var/nextcloud_data"

But the assumption that Nextcloud must be installed first, either with the Web Installer or the CLI Installer is correct. Otherwise no config.php will be created.

Very good! That could very well help Thomas!

I may be stupid, but what will the command

sudo -u www-data php /var/www/html/nextcloud/occ maintenance:install --database “mysql” --database-name “nextcloud” --database-user “nextcloud” --database-pass “nc_db_password” --admin-user “Nextcloud-Admin” --admin-pass “admin-password” --data-dir “/var/nextcloud_data”

do?

Also, you saying

But the assumption that Nextcloud must be installed first, either with the Web Installer or the CLI Installer is correct. Otherwise no config.php will be created.

But the problem is that I cant reach the nextcloud webgui to finish the installation? When I go to http://192.168.1.11/nextcloud Im only get “The requested URL was not found on this server”

Life is not easy. The occ command will do the same as the web based installer. You have to have locations correct in the command. When you are new to this its all quite confusing.
I do not understand that you cannot start the web based installer.
Is your server at 192.168.1.11? is the path for Nextcloud on your server /var/www/nextcloud? You are on Linux you know, did you check upper case and lower case?

It does the same as the Web Installer. It generates an instance ID and a basic config.php file based on the information you enter.

I have not read the complete tutorial. But if you can’t connect to the server or it can’t find the page, there is probably something wrong with the configuration of the web server or you have some network/firewall problem. Hard to say without more details.

In /var/www/ it looks like this:image

In /var/www/nextcloud it looks like this:

Server ip is 192.168.1.11 yes.

I tried moving the nextcloud dir to /var/www/html/ instead. And that worked, i was then able to connect using the webbrowser gui for nextcloud immediately. Without doing anything, I then looked in the /config folder and now the file config.php is created… although is empty. My guess is that it will be filled with more information and settings if I complete the nextcloud installation in the webbrowser.

But anyway… should the nextcloud be in /var/www/ or in /var/www/html/ ?

Because if in www, there is something that’s missing or that I have made wrong?

In my system the nextcloud directory is in the /var/www directory. This should correspond tot the file /etc/apache2/sites-available/nextcloud.conf with is to make Apache work correctly. Moving the nextcloud directory around has its consequences.
afbeelding

/etc/apache2/sites-available/nextcloud.conf :
image

/var/www/nextcloud:

Dont have a clue what I should do now to get this working… :frowning:

Ok, I got it!!

I needed to change

DocumentRoot /var/www/html

in /etc/apache2/sites-available/000-default.conf to

DocumentRoot /var/www/

And now I can access the installation with my nextcloud dir in /var/www/ :slight_smile:

Is this something that I have missed in your tutorial?

I will now finaly continue my installation following the rest of the tutorial, lets hope I dont get any more problems! :slight_smile:

Maybe you take the virtual host file from the wiki?

Not sure what you mean?