I've got a localhost apache server running. How can I run the setup-nextcloud.php from it?

I’m a designer learning to be a webdev, and I really only know frontend stuff but it seems to me that if I can set up nextcloud on a shared server using the php installer I should be able to do the same thing locally on a home server.

I installed mariadb, apache2, mysql , among other things trying to follow the various tutorials out there. Right now I’ve gotten pretty far through one but I can’t get my DNS record to connect to my local server for some reason. So I thought I would poke around, and in doing so I found the localhost.localdomain page was the default page served to my browser when my apace server is running and therefore I made the guess that I could go to localhost.localdomain/setup-nextcloud.php and run the setup. So I did and this is what I got:

Any thoughts on how I can actually achieve this?

I know there might be some people who will tell me it’s super easy to just do it the manual way, but the manual way isn’t working for me and this… well should work right? I don’t understand why it wouldn’t. So if nothing else I want to understand why it doesn’t work.

AH! I figured it out. PHP wasn’t installed! WHAT???

IDK what was up with that. That’s the thing that’s been so frustrating about so many of these tutorials. They assume I have at least one or two of the dependencies that are commonly used. But this is a fresh install so I don’t. I think this might work now!

okay new problem. Doesn’t have any of the other php stuff installed… I thought I installed that already in one of the other tutorials. Okay I’ll see what I can do about that. Also I can’t write to the webserver. I also thought I did that or something. What’s the command for that? chown something or other? Do I set the write privileges to apache? As a user or a group or what? I’m very new to linux and permissions in general.

Okay I went through the dep list and installed them with root but still no dice :frowning:

Wait… is installing with root different than installing with sudo? I thought it was but just realize that might screwi up the permissions. I just didn’t want to keep typing mysuper long password over and over again.

Anyway I ran chown and it’s no longer through the privileges error. I’ve given it privileges to write to my www folder.

Okay I’ve managed to install all the dependcies and pass all the checks, and now I have told it to install in /var/www/hmtl/cloud and it is currently… doing something… or mayb eit’s frozen or broken, it’s hard to tell.


It’s installed and now I just have to make an admin username and password and configure a database.

It is… not working though. I’m getting this error message back:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory 

Alrighty… so I looked up some stuff and the error seemed to do with MariaDB. I noticed this weird thing. So one of the tutorials I followed was for MariaDB and another was for MySQL. I did the MySQL one second and when I did that I thought I saw it say something about uninstalling MariaDB. So I reinstalled MariaDB, and did the setup all over again.

I also found a post saying MariaDB only accepts localhost from 3307 so I put that in the localhost name andI got this new message!

Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused 

SO! It’s finding it now! it’s just not able to get in… maybe I need to… make a user for MariaDB? I would expect this webinstaller to do that or something but maybe it’s asking for login information for an already existing db?

Hmmm… so I tried using mysql_secure_installation to make a new mariadb database. And I set a new password for root and then I tried the installer thing again this time putting the username for the db as root with the new password I had set and I got this as a result:

I feel like I’ve hit a dead end here. If I can figure out what to do next, I’m going to try this script: https://www.c-rieger.de/spawn-your-nextcloud-server-using-one-shell-script/

I would prefer to make it work with the web installer because that way I wouldn’t be just relying on the settings etc of some unknown third party. I mean I’m using the webinstaller in kind of a hacky way but at least it’s still the official web installer etc.

I’m trying the script now and it seems to work pretty well but I’m still hitting a similar dead end as before. I think I’m missing something really really basic here.

Okay so I tried the shell script multiple times and it did not work. I then comletely wiped my computer and tried it, and it did not work. https://github.com/riegercloud/install-nextcloud/issues/29

I then tried an ansible build suggested to me that you can find on github and it also didn’t work: https://github.com/ReinerNippes/nextcloud13

I’m pretty much at the end of my rope. I do not know how to proceed.

You already submitted an issue to this repository. What is strange, the script should normally manage all the setups, so you shouldn’t see any install message in your browser, so there must be something wrong when you started the script…

Do you have a real domain for your cloud or are you just trying something locally? With local domains, letsencrypt does not work and you should leave out these steps from the script (use self-signed ones instead, it will ask you to verify it manually on the browser on your first visit).

@riegerCLOUD is also here on the forum.

I have tried with both a subdomain of my domain (which should have the DNS records set up properly.) and trying to do so locally with the letsencrypt settings turned off.

Hey thedonquixotic
I’ve had a similar issue when setting up nextcloud installations.
If it’s the same one that I had it’s because Mariadb/MySQL will not let you remote as the root database user.
nextcloud uses the root login to create an admin database user for it’s database but since it can’t remote as root, this portion fails.
The work around that I used was I had to create a new user in mariadb with all permissions with grant that nextcloud then used to make the nextcloud admin db user.

CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';