New install Login loop

I have installed nextcloud multiple times, each time it is the same it installs properly but i get a login loop and can’t initially login, and it is in a login loop. I am using Slackware 64 14.2-current Apache 2.4.47 php 7.4.18 mysql/mariadb 10.6.0. I used the following steps to install nextcloud.

  1. Downloaded it to my home directory
  2. sudo mv nextcloud-22.2.0.tar.bz2 /var/www/htdocs
  3. cd /var/www/htdocs
  4. sudo tar xvf nextcloud-22.2.0.tar.bz2
  5. sudo chown -R www-data:www-data nextcloud
  6. sudo cd nextcloud
  7. sudo mkdir data
  8. sudo chown -R www-data:www-data apps data config
  9. sudo chmod -R g+w apps data config .htaccess
  10. sudo mysql -u root -p
  11. CREATE USER ‘username’@‘localhost’;
  12. GRANT ALL PRIVILEGES ON nextcloud.* TO ‘username’@‘localhost’ IDENTIFIED BY ‘password’;
  13. FLUSH PRIVILEGES;
  14. \q;
  15. http://192.168.0.250/nextcloud

I put in the admin username/password, select mysql/mariadb and fill in database name database
user, database password host as localhost:3306 click next and it fully installs. then it goes to http://192.168.0.250/nextcloud/index.php/login?redirect_url=/nextcloud/index.php/core/apps/recommended if i put in admin username and password it keeps loading this page. Any help on this matter would be greatly appreciated.

Hi,

by default NC redirects to https Does your login work when setting 'overwriteprotocol' => 'http' in your config.php?
(beware that this is not safe to be accessible from the internet!)
/S

I had the same issue on my Proxmox host in a Debian VM when I tried to setup a test instance of 22.2.0. I have tried all sorts combinations with overwritehost, overwrite.cli.url, overwriteprotocol etc… without success. However, after I added a self-signed certificate and accessed Nextcloud via HTTPS, it worked immediately.

Right, so then it likely is a result of the webserver configuration. Check if there are any forced https forwards.

1 Like

Nope. At first I only had a single VirtualHost for HTTP with the minimal configuration from the Nextcloud docs, no redirects whatsoever. After I created the SSL certificate and a second VirtualHost with the SSL configuration, I added the redirect of course. :wink:

Anyways… After it worked with HTTPS, I didn’t look any further to see what could have caused the issue. On a productive instance you should imho always use HTTPS anyways, even if you only use the service locally.