Full nextcloud installation guide

Very, very good guide.

Just as a tip, you could use this for enabling a cronjob instead: https://github.com/nextcloud/vm/blob/master/nextcloud_install_production.sh#L303-L304

1 Like

:wink: thanks
I will reference to your link in the next version.

new release:
v. 2.1 - August 4th, 2016: backup, upgrade, rewrite URL, crontab

…:::cheers, carsten

1 Like

Thank you! Very good guide!


1 Like

Thank you for a very comprehensive guide.

I did have one issue … /etc/nginx/nginx.conf was created with user nginx; instead of user www-data; after building the nginx server … this led to a 502 Gateway error when testing the server.


user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main ‘$remote_addr - $remote_user [$time_local] “$request” ‘
’$status $body_bytes_sent “$http_referer” ‘
’"$http_user_agent" “$http_x_forwarded_for”’;
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/conf.d/*.conf;

Hope this helps anyone else experiencing this issue

Kudos again on a great tutorial, greatly appreciated

Thank you very much - i highlited the www-data user and created a new minor version (v. 2.3)

…have a look at the very end of my guide :wink:

Thank you for your very detailed guide. I have a question about nginx: If we build nginx by ourself - how do we update it? Wouldn’t it be easier to use apt install nginx, or are there some modules missing?

Has anybody tested this together with Collabora or/and Spreed.ME and about stability and long-time performance? I am asking because I used Apache before for everything :grin:

1 Like

We compile nginx because of the separate module “ngx_cache_purge” from scratch. And for compiling reasons i choosed the current release. But you may use the ubuntu repositories as well. With regards to nginx updates: i set nginx on hold (apt-mark hold nginx) and will just update nginx manually if really needed :wink:
Cheers, Carsten

1 Like

LOVE YOUR site tutorials on Odroid C2 server. Thanks riegerCLOUD. I wanted to use nginx, but I ended up just installing Apache2 on its own.

I’m also using Ajenti 2( http://ajenti.org/) as alight weight admin panel to use SSH over the web, and to monitor services.

Whats your thoughts on using micro sd for the nextcloud vs using an external fixed disk hard drive for nextcloud? Love to hear your thoughts.


Awesome, thanks for this!

thanks for your responses.
i don’t know anything about ajenti yet.
i wouldn’t prefer sdcards. i would recommend using nas or hdd/ssd plugged to your sbc.
for os it is sufficient to use sd or eMMC.
cheers, carsten

Hello Carsten!
Those tutoirials are great! Thanks a lot for writinhg and maintaining them! I have my NextCloud up, encrypted and running perfectly thanks to your effort!

I did have one thing to fix. It’s to do with using Thunderbird and Lightning to sync with the NextCloud calendar (caldav).
When using the setup you provide, Thunderbird would not even try to log into the caldav account (no prompt appears).
To fix that, I had to change the “ssl_ciphers” string.
As at the same time, I had issues with my iPhone cooperating with the CalDav, I ended up trying quite a few combinations.
Turns out my iPhone Issue was not related to ssl_ciphers, but the Thunderbird one sure was.
This is, for reference, my current “ssl_ciphers” string. I must confess that I don’t know anything about those values. So feel free to correct me if this one poses a risk of any kind:

(I think this is the output of the Mozilla Configurator Tool, but I may be wronng).

Thanks again and keep up the good work!

Hi, I hope it is ok to use this thread for questions regarding your superb install-docs :slight_smile:
Why do you need ngx_cache_purge ? I don´t see any purge-configs in your nginx-config, or is this handled by NC (sorry, I don´t have much background on this) ?
And I assume geoIP for fail2ban ?

Cheers, Frank

the_swissionary & DerFrank: Thank you!

This could be handled in Thunderbird, you just have to set the variable


to “false”. Then restart Thunderbird and your are able to use lightning (caldav) and sogo (carddav) in thunderbird with my ssl_ciphers again.

Regarding ngx, geoip and fail2ban:

ngx is used in NGINX and increases e.g. the galery performance for Nextcloud significantly.
geoip and fail2ban are used for security purposes and to prevent your server (e.g. brutforce attacks)

cheers, carsten -
Please find my Nextcloud installation guide here

I used this very useful guide and I ran into an issue with downloading large files.

I only have an upstream of about 1Mb/s which results in a transfer time of about 9000 seconds (2.5h) for a 9Gb file. After about 4000 seconds however, it dies. It helped to increase request_terminate_timeout in /etc/php/7.0/fpm/pool.d/www.conf to (way) more than 9000 seconds (which was set to 3600 before I think). So that value should be adjusted according to your upstream (or downstream if this is your limiting factor) and the maximum file size.

You might want to add that to the guide.

Thank you - i will add an information with the next release of this guide.

Hi Carsten, thanks for your guide, it’s the most comprehensive I have found!

To all, I’m a noob who’s hoping to follow your latest guide to install Nextcloud on my rpi 3 and have a few questions that hopefully y’all can help me with!

  1. Since I’d be running my nextcloud on rpi 3 with Jessie, would I replace the adding mainline rep steps with the following?

deb http://nginx.org/packages/debian/ jessie nginx
deb-src http://nginx.org/packages/debian/ jessie nginx

  1. Would I then follow the steps as you outline up to this step:

Then start installing the new nginx-webserver, choose the package that fits your environment:

dpkg --install nginx_1.13.0-1~xenial_arm64.deb

and instead do the this?
dpkg --install nginx_1.13.0-1~jessie_i386.deb

I think the other steps, up to installing nextcloud, I am clear on. Or is there anything else I need to change for rpi installation?

That’s all my questions, I hope it’s not too unclear. Thank you all in advance for any help, I really appreciate it!


hi jesus,

i switched from RPI to Odroid C2 (for performance reasons like 2GB RAM and GBit-LAN).
but other users told me, that they still follow my instructions on rpi etc. as well on other os like debian as on jessie…
apologize i can’t response to your questions seriously and in particular, so any assistance from others is really appreciated.

cheers, carsten

I did notice you switched to Odroid, makes me wish I had found your guide sooner, because I may have bought an Odroid instead of an rpi! :sob: Though I will consider an Odroid for the future.

No worries about not being able to respond specifically for debian/jessie, I came across a nextcloud image by nachoparker for rpi3 and think I am going to use that, or try to follow his code for practice. Networking is still baffling to a noob like me, so I think this will be the best way to go.

Thank you for taking the time to reply!

So, who is annoyed compiling nginx every time a new version is released?

That script is basically what @riegerCLOUD does in his guide. Change paths if you want to build your stuff somewhere else. Also use at your own risk.

cd /opt;
rm -R nginx*;
wget http://nginx.org/keys/nginx_signing.key;
apt-key add nginx_signing.key;
apt update;
apt build-dep nginx -y;
apt source nginx;
mv nginx*/ nginx;
mkdir nginx/debian/modules -p;
cd /opt/nginx/debian/modules;
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz;
tar -zxvf 2.3.tar.gz;
cd /opt/nginx/debian;
secondflag='--with-ld-opt="$(LDFLAGS)" --add-module="$(CURDIR)/debian/modules/ngx_cache_purge-2.3"';
sed -i 's|'"$firstflag"'|'"$secondflag"'|' rules;
cd /opt/nginx;
dpkg-buildpackage -uc -b -j4;
cd /opt;
rm nginx-dbg*;
filename="$(ls *amd64.deb)";
dpkg --install $filename;
apt-mark hold nginx;
service nginx restart;
systemctl enable nginx.service