First time poster,
I have my Nextcloud working on Ubuntu Server 16.04.1 LTS and am able to login locally on my local network and devices locally. I have my home router port forwarding setup to allow access to my Nextcloud Internal IP address.
Iāve installed the Nextcloud app on my iPhone 6 and am able to sign in locally but canāt connect externally. āError it is not possible to connect to the server at this time. Request failed: gateway timed out (504)ā
Iāve verified my Netcloud server has access on port 80 and 443 (nothing else is using those ports on my network). My plex and subsonic apps are working remotely.
Now since this is my first time setting this up, here is my step by step I documented. Maybe there is something in these steps I messed up on? or something else I need to configure to allow the Nextcloud app to connect back to my home server outside of my network?
Installing NextCloud on Ubuntu 16.04
Step 1: Login in Root
(create root admin, disable when done)
sudo passwd root
sudo passwd -u root
(login)
su -
password:
Step 2: Update the System:
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
Step 3: Install LAMP Server + PHP Extension:
sudo apt-get install lamp-server^
enter in password for root user
sudo apt-get install libapache2-mod-php7.0 php7.0-mbstring php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-mcrypt
sudo apt-get install php-xml
Step 4: Download NextCloud:
wget wget https://download.nextcloud.com/server/releases/nextcloud-11.0.1.zip
Step 5: Unzip + Permissions:
unzip nextcloud-11.0.1.zip
sudo mv nextcloud /var/www/html
sudo chown -R www-data:www-data /var/www/html/nextcloud
Step 6: Configuring MariaDB for NextCloud:
mysql_secure_installation
Type n, n ,y for all except root password
mysql -u root -p
In SQL do the following;
CREATE DATABASE nextcloud;
GRANT ALL PRIVILEGES ON nextcloud.* TO ānextcloudā@ālocalhostā IDENTIFIED BY āpasswordā;
FLUSH PRIVILEGES;
exit;
Step 7: Disable MariaDB binary logging:
sudo vi /etc/mysql/my.cnf
Add the following three lines at the end:
log-bin = /var/log/mysql/mariadb-bin
log-bin-index = /var/log/mysql/mariadb-bin.index
binlog_format = mixed
Step 8: Configuring Apache Web Server:
sudo a2enmod rewrite
sudo touch /etc/apache2/sites-available/nextcloud.conf
sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf
sudo vi /etc/apache2/sites-available/nextcloud.conf
service apache2 restart
Add the following:
<VirtualHost *:443>
DocumentRoot "/var/www/html/nextcloud/"
ServerName example.com <-change this
ServerAlias nextcloud
<Directory ā/var/www/html/nextcloud/ā>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
Restart the Apache web server:
sudo systemctl restart apache2.service
Open in web browser