HowTo: Ubuntu + Docker + Nextcloud + Talk + Collabora

The site name in the Apache config is correct and the command shows the configs are loaded.

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server cloud.mygood.url (/etc/apache2/sites-enabled/010-nextcloud.conf:1)
         port 80 namevhost cloud.mygood.url (/etc/apache2/sites-enabled/010-nextcloud.conf:1)
         port 80 namevhost office.mygood.url (/etc/apache2/sites-enabled/011-collabora.conf:1)
         port 80 namevhost Name (/etc/apache2/sites-enabled/999-catchall.conf:1)
*:443                  is a NameVirtualHost
         default server cloud.mygood.url (/etc/apache2/sites-enabled/010-nextcloud.conf:15)
         port 443 namevhost cloud.mygood.url (/etc/apache2/sites-enabled/010-nextcloud.conf:15)
         port 443 namevhost office.mygood.url (/etc/apache2/sites-enabled/011-collabora.conf:26)
         port 443 namevhost Name (/etc/apache2/sites-enabled/999-catchall.conf:7)

Hmm. It’s not jumping out to me. I see Apache has selected the wrong default site too. Could you start a new thread and post all the configs?

I have created a new thread it is this:

Thank you

Hi Karlf12

Thank you for this instruction
I have a question for enabling the smb feature, I don’t understand what really need to add to Dockerfile
Can please post example file ? and what exactly commands to use
and the rebuild task will remove all my settings on the nextcloud ?

Thank you

@Efi_H Typically you can use the example Dockerfiles as they are.

@KarlF12, thank you for your tutorial!

What if I want to run Nextcloud and Collabora on different machines in the same network?

For instance, consider that Nextcloud is on and Collabora is on What should be changed on your tutorial so the connection between both servers is kept local?

@nunesgh You would need to replace the loopback addresses in Apache to direct connections to the correct server.

In Docker you would need to expose the ports to the LAN IP instead of loopback and make sure that all of the extra_hosts entries match your setup.

And of course your local DNS records would need to be correct.

1 Like

Great tutorial however there are some syntax errors. Kindly please make the necessary corrections and update it. It is very useful.

Thank you for your efforts.

For those interested, I’ve put together a small project that puts all this together and adds mail server to it. For those having difficulty you can try using my project to see how i configured it because i currently run this on a $5 vps.

Not yet corrected … Are the comments read by the team ? :face_with_monocle:

I think I have found the problem. I thought I’d fixed it before. Some of the “quotes” ended up as “quotes” because I edited the post on my phone at one point, and I guess Apple feels that the nonstandard quotes are better. Turns out Docker doesn’t appreciate Apple’s artsy-fartsy quotes and will barf if they’re in the compose file.

If by team you mean me, yes I do read them.

I mean, at least 3 of us mentionnened this little mistake in this great tutorial. If the author doesn’t have the time to make a correction, maybe a moderator should ?

VPN Problem with Nextcloud
Thanks to KarlF12 I finally have a quite performant NextCloud! Thanks a lot :slight_smile:
Now the next problem has occurred: VPN.

For Nextcloud to run smoothly, I had to set up my own dns server with dnsmasq (and register it in the router).
As soon as I connect via VPN, the Nextcloud domain becomes unreachable.

Does anyone have an idea what this might have to do with?

Quite possibly DNS again to be honest. DNS can be funny with VPNs. So the first thing to check is, when you are offsite and connect your VPN, what DNS server are you using? You may need to configure your VPN to use your dnsmasq as the DNS server while the VPN is connected.

It’s also possible the VPN itself is not working as intended. Can you ping your Nextcloud server by its local IP address over the VPN?

I spent untold hours of my precious spare time figuring all this out, and then some more writing up a proper guide, and some more still doing a test installation following my own steps to make sure it worked. Sorry if you aren’t satisfied with it.

As I said I thought I had fixed all the quotes my iPhone swapped out back in August but evidently not.

I’m totally satisfied and enjoy tour work !! whoever said he wasn’t satisfied would be a terrible bastard since there’s only very few settings to add (like settings HTTP_X_FORWARDED_FOR in config.php)

You did 99.9% of the job, the least thing would be to make this obvious fix for you and not bother you with it given the extent of the work done. I regret that we could not do that for you, it is disrespectful of the great work provided to the community that must be proud to have someone like you to help all of us :+1:

1 Like

When trying to update my docker image with smb support, I’ve followed the instructions up to here including not changing permissions on html and mariadb (mariadb folder is filled with red x icons on every file/folder), when I use docker-compose build --pull I get:

Building nextcloud
Traceback (most recent call last):
File “bin/docker-compose”, line 3, in
File “compose/cli/”, line 67, in main
File “compose/cli/”, line 126, in perform_command
File “compose/cli/”, line 302, in build
File “compose/”, line 468, in build
File “compose/”, line 450, in build_service
File “compose/”, line 1125, in build
File “docker/api/”, line 160, in build
File “docker/utils/”, line 30, in tar
File “docker/utils/”, line 49, in exclude_paths
File “docker/utils/”, line 214, in rec_walk
File “docker/utils/”, line 214, in rec_walk
File “docker/utils/”, line 184, in rec_walk
PermissionError: [Errno 13] Permission denied: ‘/home/username/nextcloud/mariadb/nextcloud’
[35533] Failed to execute script docker-compose

Thank you very much for this tutorial, prior to this I was using snap nextcloud but felt limited. I did run into an error on step 6. Setting up nextcloud. I hit the setup page and when I attempted to create the admin account, it spun for awhile and then failed. Now I just get a generic error when attempting to hit my url. I reviewed the logs but they didn’t seem to provide anything too beneficial. The only question I had during setup was the NEXTCLOUD_IPADDRESS= I set this to the internal IP of the computer? I’m not sure if that would impact anything as I was able to hit the site.

This should be set to the LAN IP of the system running Docker (not the container IP or public IP). This is used to create /etc/hosts entries within the containers to ensure that NC and CODE connect to each other via the reverse proxy where they will be presented a valid certificate.

If you’re not using Collabora or are using the built-in version, this probably isn’t needed.

1 Like

This was actually the hint that solved my issue. My VPN did block it by configuration and i wasn’t aware this was even an option :slight_smile:
My wife and me are enjoing the nextcloud setup so much for the last few weeks and really hope this will proof to run solid. Than we can migrate things like the calender into it and we are quite excited.

Thank you for this guide and your support!


Thank you very much for this HowTo. Unfortunately the nextcloud does not run as desired. When I start nextcloud for the first time, I get the following error message:

The request identifier is new every time, the remote IP address is unknown to me. What went wrong?