Previous Page

nihilist - 00 / 00 / 00

Easy install of Nextcloud

The idea here is to use snap to install nextcloud.

If you have ubuntu server , great because snap is already pre installed but if you are not, then you need to install it. So for this tutorial we're going to go with Debian 10+ servers:

	su -
	apt update -y
	apt install snapd sudo curl ufw mlocate -y
	/sbin/usermod -aG sudo [NAME OF THE NON-PRIVILEGED USER]
	/sbin/ufw allow 22
	/sbin/ufw allow 80
	/sbin/ufw allow 443
	/sbin/ufw enable
	snap install core

Install Nextcloud

Using snap, installing nextcloud is fairly simple:

	su -
	snap install nextcloud

	ip a | grep inet

you can verify that the nextcloud server works by going at the ip adress of the server http://server_ip/ where you'll create the administrator account.

Once that's done you should have access to your nextcloud instance, but instead of accessing it through the ip address, we'll set it up in such a way that we can access it through a domain name (for example DuckDNS) and with a HTTPS certificate.

Log into DuckDNS and register a domain name pointing to your public ip like so:

Configuring Nextcloud

Now that we have the domain name pointing to the public ip address of the nextcloud server, we can setup the https certificate using let'sencrypt, just ssh into your server once more and run the following commands:

	su - 
	nextcloud.enable-https lets-encrypt
	nextcloud.occ config:system:set trusted_domains 1

And once that's done, you can access your nextcloud instance from a free domain, which uses a free HTTPS certificate ! at

If you installed this nextcloud server locally and behind a reverse nginx proxy, then you would need to allow the domain to be accessed:

root@cloud:/var/snap/nextcloud/common/nextcloud/data# PATH=$PATH:/snap/bin/
root@cloud:/var/snap/nextcloud/common/nextcloud/data# which nextcloud.occ

root@cloud:/var/snap/nextcloud/common/nextcloud/data#  nextcloud.occ config:system:set overwritehost --value=""
System config value overwritehost set to string

root@cloud:~# nextcloud.occ config:system:set overwriteprotocol --value="https"
System config value overwriteprotocol set to string https

In order to upgrade your nextcloud, you can run the following, and also add it to cron to run automatically every day at midnight:

root@cloud:~# sudo snap refresh nextcloud
snap "nextcloud" has no updates available

root@cloud:~# crontab -e


0 0 * * * /usr/bin/snap refresh nextcloud


--2022-12-17 20:34:07--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2022-12-17 20:34:07--
Resolving (,,, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6326130 (6.0M) [application/octet-stream]
Saving to: ‘linux_amd64.tar.gz’

linux_amd64.tar.gz                                           100%[===========================================================================================================================================>]   6.03M  6.47MB/s    in 0.9s

2022-12-17 20:34:09 (6.47 MB/s) - ‘linux_amd64.tar.gz’ saved [6326130/6326130]

root@cloud:~# sudo tar xvf linux_amd64.tar.gz -C /usr/bin/
root@cloud:~# sudo cronitor configure --api-key 1234567890

Configuration File:


API Key:

Ping API Key:
Not Set

Not Set


Timezone Location:

Debug Log:
root@cloud:~# cronitor select

✔ /usr/bin/snap refresh nextcloud
----► Running command: /usr/bin/snap refresh nextcloud

snap "nextcloud" has no updates available

----► ✔ Command successful    Elapsed time 0.451s

By default the nextcloud instance does not allow uploading large files, so to fix that you can do the following (as stated here

root@cloud:~# snap set nextcloud

#and if you put your nextcloud behind a nginx reverse proxy, you will need the "client_max_body_size 20G;"  line in the nginx config.

[ ] [ home ] [~]
→ cat /etc/nginx/sites-available/
upstream cloudbackend {

server {
        listen 80;
        listen [::]:80;
        return 301 https://$server_name$request_uri;

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;

        ssl_certificate /root/;
        ssl_trusted_certificate /root/;
        ssl_certificate_key /root/;

        ssl_protocols TLSv1.3 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        ssl_session_tickets off;
        ssl_ecdh_curve auto;
        ssl_stapling on;
        ssl_stapling_verify on;
        resolver valid=300s;
        resolver_timeout 10s;

        add_header X-XSS-Protection "1; mode=block"; #Cross-site scripting
        add_header X-Frame-Options "SAMEORIGIN" always; #clickjacking
        add_header X-Content-Type-Options nosniff; #MIME-type sniffing
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";

        location / {
                proxy_pass http://cloudbackend;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                client_max_body_size 20G;


And that's it! This is a very simple installation of nextcloud, you can use it as a server to host your keepass passwords database for example. To do so, just use the URL feature of keepass, and use the webdav link that points to the kdbx file you uploaded on the nextcloud server. You can also just install the keeweb extension on nextcloud for it.

To use it in keepass, simply upload your .kdbx file into your nextcloud once logged in, then use the keepass OpenURL feature as follows:

example URL:

To mount the nextcloud share on a windows machine, like you would sync a sharepoint drive, do the following:

Or you can just install the official nextcloud client here ] [ nowhere ] [~]
→ sudo pacman -S nextcloud-client
[sudo] password for nothing:
resolving dependencies...
looking for conflicting packages...

Packages (4) karchive-5.103.0-1  qt5-websockets-5.15.8+kde+r3-1  qtkeychain-qt5-0.13.2-1  nextcloud-client-2:3.7.3-1

Total Download Size:    4.48 MiB
Total Installed Size:  16.02 MiB

:: Proceed with installation? [Y/n] y

Once logged in you can check the progress in the system tray:

Then let it automatically sync.


Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8

Contact: (PGP)