# Help setting external access to nextcloud

**URL:** <https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634>\
**Category:** ℹ️ Support\
**Tags:** network\
**Created:** [November 30, 2016, 1:47am UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634 "2016-11-30T01:47:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 1:47am UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/1 "2016-11-30T01:47:45Z")

</div>

Hi everyone,

I have successfully setup next cloud and am able to access it perfectly while on the same network. Although i’m in need of some help setting up access externally when i’m not on the same network. while i would say in tech savy this is beyond confusing me

Any help would be amazing

**Update**  
so i have now port forwarded ports 80 to 443 on my router and im able to access the nextcloud login page although i cannot login as it tell me im not on a trusted domain ?

FYI im using the easy premade linux method so no GUI

UPDATE

I have now reinstalled everything again using the long liunx method with gui. Although i keep getting this error  
 ![](https://help.nextcloud.com/uploads/default/original/2X/c/cb466d7009f3bdc09f477147523133e8686fc7b9.png)

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 8:53am UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/2 "2016-11-30T08:53:42Z")

</div>

So, you need to:

Forward port 443 from the firewall (router) to 443 on the NC server (or 80 for non-SSL setups). Forwarding 80 TO 443 sounds like you’ve opened every port from 80 to 443. If that’s not the case then great, but you only need one of those ports.

Next, it’s now telling you that the only trusted domain you’ve added during installation is likely the internal IP address. For security it doesn’t allow anyone to connect via any domain pointed at your server. It should have prompted you to add it automactically by logging in and clicking authorise, but if not, you can add it in your `config/config.php` file located in the root of your NC installation (`/var/www/html/nextcloud/`)

In there you can find and edit so the lines read like:

```
  'trusted_domains' =>
  array (
    0 => '192.168.1.100',
    1 => 'cloud.domain.com',
  ),

```

Finally it’s indicating you have a permissions issue, so you need to SSH back into your server and do a `sudo chmod -R 770 /var/www/html/nextcloud/data`. Really it sounds like you might need to find the permissions guide on the NC docs to ensure you’re not leaving anything else world-readable also.

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 12:39pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/3 "2016-11-30T12:39:44Z")

</div>

Hi Jason,

Firstly i want to say thank you for helping me out, in the end i ended up reinstalled for a 3rd time and i now have it work but i will be saving everything you wrote there, for troubleshooting.

Just a quick question you might know the answer of, when accessing nextcloud from another machine/ device, am i going to have to keep editing the config.php to allow each machine ?

**UPDATE**

so i have tested nextcloud from a different IP and a different device and it allows me to login fine without having to authorise anything. is that normal ?

also i type in just my ip address without /nextcloud i can get access to the Apache2 Ubuntu Default Page is that safe, for people to be able to to access that page just by typing in my IP.  
Should i just remove the file its pointed to and that should bring up nothing correct ?

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 12:56pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/4 "2016-11-30T12:56:43Z")

</div>

No need to auth from each machine, just for each domain you want to use to connect to it, for example if you had a home server with DNS pointing:

[cloud.domain.com](http://cloud.domain.com)  
[update.domain.com](http://update.domain.com)  
[mysite.net](http://mysite.net)  
[beta.clientsite.org](http://beta.clientsite.org)

to the one web root, being able to get to NC when you append /nextcloud to any domain, you’d have to add all 4 domains to the config. That’s all. Similarly anyone can point their domain at your IP, however unless you’ve authorised it Jim using [fraudulentdomain.de](http://fraudulentdomain.de) can’t pretend to be your NC cloud offering.

The default apache page offers nothing in the way of security issues. Leave it there if you have nothing to replace it with, otherwise it’ll just 404 on someone who types in the domain/IP without /nextcloud.

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 2:34pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/5 "2016-11-30T14:34:55Z")

</div>

you are a superstar 🙂

next question haha i need to edit the config.php but the last time i tried to do this the file was locked. the only way was to edit the permissons but thats what messed up my next cloud last time.

i need to do this because i get this message “No memory cache has been configured. To enhance your performance please configure a memcache if available.” from what i have read i need to install Redis and edit the config.php

off topic when using the next cloud android app the auto upload doesn’t seem to work, im on android 7.0 using the next-cloud beta apk

also getting this error “Last cron job execution: 2 hours ago. Something seems wrong.” im able to upload and download files so im not sure if this is something to worry about or not

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 2:38pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/6 "2016-11-30T14:38:32Z")

</div>

> [@Jake\_Mallon](#):
>
> edit the config.php

Use sudo, don’t change permissions of the file

> [@Jake\_Mallon](#):
>
> “No memory cache has been configured. To enhance your performance please configure a memcache if available.”

Would you believe, I have a guide for that: [here](https://bayton.org/2016/07/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-apache/)

> [@Jake\_Mallon](#):
>
> auto upload doesn’t seem to work

There are several topics covering this already, do a search and if you can’t relate, open a new topic for it 🙂[quote=“Jake\_Mallon, post:5, topic:5634”]  
also getting this error “Last cron job execution: 2 hours ago. Something seems wrong.”  
[/quote]

Have you setup the cronjob, or just ticked the box for cron?

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 2:42pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/7 "2016-11-30T14:42:16Z")

</div>

ok many thanks i will take a look

i have looked at the other topics i believe i found one where u was having a similar issue although nothing on them seems to work for me.

The box was ticked on install i haven’t set it up?

Think i’m out of my knowledge zone here lol

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 2:55pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/8 "2016-11-30T14:55:06Z")

</div>

> [@Jake\_Mallon](#):
>
> The box was ticked on install i haven’t set it up?

[https://docs.nextcloud.com/server/9/admin\_manual/configuration\_server/background\_jobs\_configuration.html#cron](https://docs.nextcloud.com/server/9/admin_manual/configuration_server/background_jobs_configuration.html#cron)

> [@Jake\_Mallon](#):
>
> i have looked at the other topics i believe i found one where u was having a similar issue although nothing on them seems to work for me.

If you’re unsure, just start a new topic.

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 3:20pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/9 "2016-11-30T15:20:15Z")

</div>

ok so we are getting there haha.

so i think i have setup cron correctly just waiting to see what happens in 15 minutes.

now i didnt have this issue before but now i do. i cannot access my next cloud via HTTPS if i try the page just isn’t found, but works fine using just http. i have looked at a few different guides but im still confused

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 3:24pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/10 "2016-11-30T15:24:29Z")

</div>

If you’re using Apache, is your vhost set up correctly? Any changes since it worked?  
When you say not found, is that a 404 or something else?

Have you done the steps to enable https?

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 3:30pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/11 "2016-11-30T15:30:09Z")

</div>

the changes since it last worked is a complete reinstall lol.

i get this This site can’t provide a secure connection.192.168.0.9 sent an invalid response.

i looked at below but i dont understand where is the Apache VirtualHosts config file ?  
[https://docs.nextcloud.com/server/9/admin\_manual/configuration\_server/harden\_server.html](https://docs.nextcloud.com/server/9/admin_manual/configuration_server/harden_server.html)

i guess my cron isn’t working Last cron job execution: 21 minutes ago ☹

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 3:41pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/12 "2016-11-30T15:41:12Z")

</div>

I’m guessing you’re on Ubuntu, which is `/etc/apache2/sites-available/`

Have you reinstalled apache also? If so you’ll need to re-enable the modules for SSL (as well as others) and sort out your SSL certs in the proper locations (or those you define in the vhost)

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 3:54pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/13 "2016-11-30T15:54:42Z")

</div>

found it great but when i add

VirtualHost \*:80  
ServerName [cloud.nextcloud.com](http://cloud.nextcloud.com)  
Redirect permanent / [https://cloud.nextcloud.com/](https://cloud.nextcloud.com/)  
/VirtualHost

nextcloud becomes completely unreachable.

This is stressful been doing this for two days now

ran a2enmod ssl  
a2ensite default-ssl  
service apache2 reload

and it say all ready enabled

if i ask support would they teamviewer in and help ?

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 4:11pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/14 "2016-11-30T16:11:28Z")

</div>

I’m not 100% sure what you’re doing there.  
If you want SSL to work you need to configure SSL on port 443, not create a \*:80 vhost in the SSL file. You can redirect the non-https traffic later, when https actually works.

I think you should go through [my guide](https://bayton.org/2016/07/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-apache/) step by step from step 4. Ensure you have the right packages installed, then go one step at a time through setting up SSL, pretty links, installation, etc. If you can’t follow that let me know and I may be able to edit areas to make them clearer.

Support will offer paid help, otherwise you’re stuck with us 🙂

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 4:20pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/15 "2016-11-30T16:20:22Z")

</div>

hi there,

thanks for your help, just didn’t want to bug u anymore with silly questions but as its paid support might need to pick your brain for abit.

as i though most of step 4 fly’s as it was all installed although when i get to step 5

sudo vim /etc/apache2/sites-available/nextcloud.conf

this command is not found ?

"jake@ubuntu:~$ sudo a2enmod ssl  
[sudo] password for jake:  
Considering dependency setenvif for ssl:  
Module setenvif already enabled  
Considering dependency mime for ssl:  
Module mime already enabled  
Considering dependency socache\_shmcb for ssl:  
Module socache\_shmcb already enabled  
Module ssl already enabled  
jake@ubuntu:~$ sudo vim /etc/apache2/sites-available/nextcloud.conf  
sudo: vim: command not found  
jake@ubuntu:~$ "

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 4:22pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/16 "2016-11-30T16:22:25Z")

</div>

`sudo apt install vim` – it’s just a package to edit files, so you could use whatever you were using to edit the conf file if you prefer. In fact, might be easier that way. gedit, nano, something else?

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 4:27pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/17 "2016-11-30T16:27:04Z")

</div>

sudo a2ensite nc-redir.conf does not exsist ?

trying to use echo ‘Hello, world.’ \>nc-redir.conf but i get permission denied

---

<div class="post-metadata">

**Author:** ![JasonBayton](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jasonbayton/32/297_2.png) [@JasonBayton](https://help.nextcloud.com/u/JasonBayton)\
**Post date:** [November 30, 2016, 4:29pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/18 "2016-11-30T16:29:17Z")

</div>

Yes, you’d have to create it and populate it with the information in the guide before trying to enable it.

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 4:34pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/19 "2016-11-30T16:34:39Z")

</div>

trying to use echo ‘Hello, world.’ \>nc-redir.conf but i get permission denied in /ect/apach2/sites-available even with sudo at the beginnning

---

<div class="post-metadata">

**Author:** ![Jake\_Mallon](https://help.nextcloud.com/letter_avatar/jake_mallon/32/5_5575768a8748004e209b776fc1b2916d.png) [@Jake\_Mallon](https://help.nextcloud.com/u/Jake_Mallon)\
**Post date:** [November 30, 2016, 5:16pm UTC](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634/20 "2016-11-30T17:16:00Z")

</div>

ok well i think i have done something right and something wrong i am now able to access the nextcloud page with https although the https itself is red with a cross going through it.

on the admin page security and setup warnings say all checks passed

cron still says something seems wrong.

[Next page](https://help.nextcloud.com/t/help-setting-external-access-to-nextcloud/5634.md?page=2)
