How do you self-host Nextcloud?

Hi everyone.

I’m wanting to self-host Nextcloud as I’ve heard that it is the best solution for privacy and owning your data.

So my goal is to completely own my data.

I am completely new to self-hosting and I don’t know where to start. I’ve tried looking for guides online but I can’t seem to find a clear cut guide on how to self-host, starting from no knowledge on how to do it.

How can I get started?

Are there any easy to follow guides out there that are geared towards privacy and owning your data?

Also, are there any drawbacks to self-hosting that I should be aware of? Do I need to maintain it regularly or does it “just work” once it’s all set up?

Thanks in advance!

1 Like

Hello, please do some basic research. Read docs.nextcloud.com or try a basic search of the internet to answer this question. We are volunteers, so please understand this is a very generic question. Try a bit of research first.

Start with an internet or forum search. Something like “should I self host” or “how to install nextcloud”. Once you have a more specific question you’ll be able to get more specific advice. Perhaps it is not Nextcloud, but servers / linux in general you might need to understand first for selfhosting.

Thanks!

Links to those you’ve read and more info on why they weren’t helpful would be really helpful!

1 Like

If you are complete new setup, Nextcloud AIO might be good start, but please read the installation document careful and plan your data.
If you have existed Nextcloud with data, that will be much difference.

understand linux first and get to know the software involved.

choose a OS and read its documentation.

https://www.debian.org/doc/

choose a webserver that is widely used and is well documented.

https://httpd.apache.org/docs/

NC uses a SQL database

https://mariadb.com/kb/en/documentation/

NC is build upon php which is used localy and by the webserver

https://www.php.net/manual/en/index.php

once you cleared all these manuals admin and user side there can be no more questions.

ofcourse updates come reguarly so it must all be maintained. but to be true I have had no major issues except for php during my 5year usage of NC.

maybe the most important of all how to use a search engine

best of luck

2 Likes

IF you are self-hosting at home and IF there will not be multiple accesses, then you can use the SQLlite3 database which comes with NextCloud. It will (should?) not need any management unlike Postgress or MariaDB. If however you are expecting multiple concurrent accesses then SQLlite3 is just not capable.

Hi … I don’t know if this is going to help !
But I only know a little Linux …
No php or sql.
But I’ve managed to get it working at hone !.
I have a domain name registered at fast hosts .
Installed virtual box
Downloaded the vm image of next cloud and fumbled the few instructions you need to get it going …
And apart from an issue with smtp not working for email alerts it’s a goer !.
I put the accompanying app on my phone and my work pc and . They sync files to and from my home machine …
It is possible to do with just a little knowledge .
Not sure I would have been able to get it going on a blank Linux install … Might have a go next !
Hope that’s of some help !
Paul

1 Like

Self Hosting is a huge topic and there are many ways to get started.

I think this previous comment suggesting to install bare metal and from scratch is an unneccesarily steep path towards getting started with self hosting. There is value to knowing exactly how everything works, but for the beginning I see it as too complicated. For many years setting up a LAMP stack was the default starting point, but I think at this point so many projects around self hosting give better starting points.

My recommendation:

If you plan to have no dedicated computer for your Nextcloud (for example running it on you normal PC):
I suggest starting with the Nextcloud VM image, that allows you to set up Nextcloud easily on a computer with any operating system: GitHub - nextcloud/vm: 💻☁📦 The Nextcloud VM (virtual machine appliance), Home/SME Server and scripts for RPi (4). Community developed and maintained.

Pros:

  • very cheap, no additional hardware necessary
  • easy to get started with
  • good tutorials available in the documentation

Cons:

  • Your PC needs to run for Nextcloud to function, so running it 24h/day may not be ideal for energy consumption and noise

If you plan to have a dedicated computer (“server”) for your Nextcloud I suggest using a server operating system, that is beginner friendly:

Pros:

  • easy to get started with
  • no need to run your computer 24/7

Cons:

  • you need a dedicated PC to use as you server. Could be an old PC you might have lying around, a used PC bought from Ebay, a new PC (expensive of course) or a Raspberry Single Board Computer (cheap, but limited performance).

Options for the server OS:

  1. YunoHost:
    Their documentation seems great, see Self-hosting | Yunohost Documentation

  2. Umbrel:
    Seems VERY easy to get started. Documentation seems good.

  3. CasaOS:
    Seems very easy to get started, but the community seems mostly Chinese, so depending on your nationality there may be a language barrier, when asking questions. Also I think while it makes installing very easy, fixing problems, that may arise, may not be easy here.

I have no personal experience with any of the above, I personally got started with the traditional LAMP setup method. I personally currently use Unraid, which is also beginner friendly, but not as much as the options above and not free.

General tips from me:

  • Don’t get discouraged. Self Hosting is a very deep rabbit hole, It might seems intimidating at first, but it is a lot of fun and you can learn a lot.
  • You will probably want to be able to access your nextcloud instance from everywhere, not just your home. Port Forwarding is the default answer, but depending on your ISP it can be complicated. I instead recommend using Tailscale.
  • There are a lot of good videos on the topic of self hosting. Just look around and find a channel with a presentation style, that fits you.

For the most part things just work, but DEFINITELY not always. You need to update the software you host to stay secure. And you need to be ready to fix issues, when they arise, which mostly happens after updates or hardware failures.
I myself have fun running my own servers, but if after trying it for a bit it seems like a hassle, not fun for you, Self hosting might not be the right thing for you. It needs to be fun or worth it for you :slight_smile:

4 Likes

Hello,

For anyone who has very little or even no knowledge of Linux / Servers / Networking, I feel Snap version is the way to go.

Snap Nextcloud comes with all the needed dependencies and it updates itself so no needing any maintenance at all. Lastly, installation is dead simple for anyone.

How to install Snap NextCloud?

  1. Choose your hardware

Select the system in which the server is suppose to run. It can be an old desktop or laptop or a dedicated 2nd hand server.

  1. OS Install

There are hundreds of guides and step by step videos available for Ubuntu server installation. Follow anyone of them,

Download Ubuntu Server LTS ISO
Create USB Bootable installation
Install Ubuntu Server with SSH Access enabled.

Use your router DHCP or Ubuntu OS itself to assign a static local LAN IP address to this machine.

  1. Install Snap Nextcloud

Log into the server using SSH via any computer on same local LAN (WiFi or Wired) by typeing following in the PC or MAC terminal ssh username@server.ip.address

Run following three commands,

sudo snap install nextcloud
sudo nextcloud.manual-install user-name password
sudo nextcloud.occ config:system:set trusted_domains 1 --value=server.lan.ip.address

Your next cloud installation is done and server is now accessible via network. http://server.ip.address

Snap next cloud will update itself whenever there is a new update is available. From maintenance point a view, you won’t need to login to this server anymore (apart from OS update off course)

Thanks.

1 Like

This would really be the main advice I would give. Not only will you have to maintain Nextcloud, but also the system you’re running it on. You will likely also have to troubleshoot from time to time. If you don’t know how to do this, and none of the guides are making sense, you will need to fill in that knowledge gap. It’s going to be a lot of self-study and a lot of learning by doing.

You should have at least a rudimentary understanding of day-to-day Linux operations (basic CLI commands, how to navigate around, how to update, how to read logs, etc.). Some knowledge of your chosen web server would also be greatly beneficial (e.g. Apache).

Also understand that since it’s your server and your data, you have to be the one to make sure it’s secure. That means checking on it from time to time, patching everything regularly, periodically doing major OS and NC version upgrades and working through any issues that may arise from that, and backing up your system. Do not skip the backup.

4 Likes

Very nice post but without knowing what your doing is stupid.

Blindly following tutorials and running commands is the dumbest you can do.

using snapd for NC requires you to know SNAPd Installing snapd | Snapcraft documentation

same with docker https://docs.docker.com/

aside imo these programs bring more complications than a bare install.

Docker does not apply memory limitations to containers by default. The Host’s Kernel Scheduler determines the capacity provided to the Docker memory. This means that in theory, it is possible for a Docker container to consume the entire host’s memory.

Docker takes a conservative approach to cleaning up unused objects (often referred to as “garbage collection”), such as images, containers, volumes, and networks: these objects are generally not removed unless you explicitly ask Docker to do so. This can cause Docker to use extra disk space.

source: Prune unused Docker objects | Docker Documentation

PS. A Raspberry PI is a developers board not a server.

It looks like self-hosting takes a lot of work and maintenance. I’m wondering if it’s even worth it.

Since I would have only used it for cloud storage, should I just switch to Proton Drive when it becomes more developed? (Though there might be a lot of waiting)

What would the difference between self-hosting Nextcloud and Proton Drive be in terms of privacy and security?

Or what about iCloud with Advanced Data Protection (E2EE)? Could iCloud with Advanced Data Protection replace Nextcloud’s cloud storage?

What do all of you think?

At the end of the day, only you can decide that.

Maybe you should approach this hole thing differently and think about whether you really need access to your entire data stock always and from everywhere, and then the prerequisites for such a service (selfhosted or not) look different again.

Sure, you probably need things like calendars, contacts and a few recent files, maybe a grocery list and a few other things… But do you really need to have access to the data of your entire life, like e.g. the photos of the last 30 years, important documents such as certificates, testimonials, wills etc… at any time? Maybe it is enough to store these things on one or better two drives or a NAS that is offline, and only have access to them when you are at home.

You could still do encrypted backups to a cloud service by yourself, but I would not rely on promises from commercial companies like Proton, and definitely not from Apple, especially when it comes to things like data security or privacy…

Well, neither with ProtonDrive nor with Apple you have control over what happens to your data. And even if these services keep their promises, TOSs, laws, prices etc… can change at any time, or the service suddenly proves to be not as secure as you thought it is, see e.g. LastPass…

in addition to that, even with end to end encryption, there is still a lot of meta data. Things like how much data was transmitted when from where, can still allow a lot of conclusions about you, even if the actual content of the data can’t be read.

That wasn’t my goal.

What would those be? That’s what I am looking for.

Yes, that is what I need. I am looking for a solution to that which covers privacy and security.

No, I don’t need that. It’s not my goal. I want to keep those locally, and if it’s local I already own it. I’m looking for a way to have things on the cloud (meaning, I can access it from anywhere), while still owning the data.

Proton Drive is open source though, so technically we can see what is done with our data and whether it is truly encrypted, which might not be the same as control, but isn’t that all we need?

I didn’t know that. What could be concluded from that type of information? Isn’t meta data too vague to be able to make conclusions?

Hi @Some1,

“Don’t come back here till you’ve proven you have read all the manuals and you can type all bash commands with your eyes closed.”

These are the initiation rituals of the very closed open source community. Don’t let them put you off!

If you don’t want to build and maintain your own server and have some money to spend: you can run about everything in Docker on a Synology NAS. This site has very accurate tutorials, also for Nextcloud. But you will need a model with Intel or AMD processor to run Docker and lots of RAM or upgradable RAM to run multiple Docker containers. These are the more pricy models.

I did about everything they are telling you here not to do. It was great fun and I learned a lot by being stupid and blindly following tutorials. I did not go back to school to study debian, Linux, PHP and MySQL first.

Instead I got me an Intel NUC as mini server to experiment with (NUC7PJYH with Pentium Silver J5005 4-core). 20 years of experience with Windows but never done anything with Unix. I installed Ubuntu LTS on it from a bootable USB and it simply worked from start. Desktop version, not server because I love GUIs and get sweaty hands from command line. And I just started trying….

Now 4 years later it is running 2 WordPress staging websites, a Discourse forum (like this one) for a small community, a large Piwigo photo database and Nextcloud, just for myself. I use it for syncing files, calendar and contacts across my devices.

I never had any issue with the server itself. It never crashed, I went from 18.04 LTS via 20.04 LTS to 22.04 LTS. Every month I click on ‘Install all updates’. Much, much more reliable than Windows Update, although that has improved the last few years.

The little server consumes about 11 Watt on average with a 2 TB SSD in it. It officially supports 8 GB max, but I had 2 x 16 GB lying around and it works perfect.

I’ll mention some minor headaches I had to go through. Always found solutions by ducking around on the Internet:

  • Running the server headless. Linux on the NUC would not boot without a monitor attached. I had to install a driver that creates a dummy virtual monitor. For GUI access I run KDE Connect on the server and VNC Viewer on my desktops. And Teamviewer when I’m not at home, but I only needed that once. After a few years I lost my fear of SSH and I’m using that as well sometimes.

  • Running multiple web services. I started with Discourse, again: by blindly following a tutorial with commands, without really knowing how Docker works. After that I tried to install WordPress natively but that resulted in a fight for port 80 (http) and 443 (https). So I learned that you can make an application use different ports by editing config files. In the end I started understanding what Docker is about and now everything runs in Docker containers. As a GUI lover I’m using Portainer to manage them.

  • Using my own FQDN and subdomains. If you want to run multiple web services and make them accessible from the outside world on *.yourdomain.com you need something called a reverse proxy. I am lucky to have a fixed IP address but otherwise you’ll need dynDNS as well. After a day of fruitless fiddling with NGINX and HAProxy I discovered that my Synology has a reverse proxy function, a bit hidden in the Control Panel settings. With a nice GUI you can make it send traffic for https://nextcloud.yourdomain.com to something like 192.168.1.2:9833. The Synology also takes care of renewing the Letsencrypt (wildcard) certificate.

What I have not solved yet: an all-in-one backup solution. There is a Backup app for Nextcloud but I could not get it working and many others are reporting issues with it. Currently I backup all applications separately. Discourse has a build-in backup tool, For WordPress there are plugins. Piwigo and Nextcloud I backup by putting them in maintenance mode, making an SQL export and copying all files to my NAS. That is extremely slow for Nextcloud. It is time-consuming and needs improvement.

So IMHO you can learn by trial and error if you make sure you have an alternative until your confident it works reliable enough.

2 Likes

Yes, and that’s what makes your question difficult, because it depends on what level of security, privacy you want. Or to put it simple: It depends on how paranoid you are :wink:

Or to be me more specific:

From whom do you want to protect your data? “Normal” people, cyber criminals, commercial companies, state actors like public authorities or intelligence agencies…

How strong must the data be protected? Only against remote access, or even if someone comes into your home. I mean authorities in the UK and other places can force you to give out your password or encryption keys under certain circumstances. Do you give it out then, or do you plan to go full “Julian Assange” or “Edward Snowdnen” :wink:

However, I can tell you a few reasons why I host it myself.

  1. i have always been interested in technology and self-hosting is a hobby for me.

  2. i strongly believe that it is not good thing, when a few big tech companies like Apple, Google, Amazon, Microsoft are managing a majority of the world’s tech infrastructure and data.

  3. the internet should remain as decentralized as possible.

  4. I think users should have control over their data. But I don’t have the illusion that it can be a 100% secure from hackers or state actors, if they absolutely want to get to it.

  5. There is no such thing as a 100% security anyways, not even with local data, unless it’s completely air-gaped, because you could still catch a trojan on your PC, that is able to steal your local data when it’s de-crypted, or maybe steal a session token of your Proton Drive session…

At the end of the day, it depends on how much effort you want to put in, and as I said before, how paranoid you are. These questions can’t be answered with a simple yes or no, and there is probably no service that checks all the boxes.

My advice:

If you are not willing to invest time to learn and maintain things properly, it might be better to use Proton Drive or another similiar service you trust, or maybe you can use a hosted Nextcloud provider, instead of hosting Nextcloud yourself.

Option 2: Don’t make your Nextcloud publicly available, and use a VPN to access it remotely. This significantly reduces the possible attack vectors. However, you still have to patch and maintain the server OS and Nextcloud.

Option 3: Use a commercial NAS like Synology or QNAP. These offer similar features as Nextcloud, but are much easier to configure and maintain, and the data is still hosted locally instead of in a cloud.

1 Like

It looks like you put a lot of work into this. Do you think it was worth it?

What benefits do you think you gain by doing this?

But isn’t that closed-source/proprietary?

Thank you for the detail.

Do you think that it’s not worth self-hosting if you don’t see it as a hobby?

I wasn’t going to make it publicly available anyway. But I’m guessing that patching and maintaining the server OS and Nextcloud takes a lot of time and you’d have to know what you’re doing.

But aren’t these closed-source/proprietary?

Not sure what you want me to say, I’m not the guy who tries to proselytize people.

And yes, I absolutely think it’s worth it, but I also know that it takes a fair amount time to do it properly, at least if you are still a newbie. Of course, over time you will gain more knowledge and then, it takes less time to maintain it.

However, if you’re not convinced whether you want to take that time, I think the next best thing would be a Synology.

Sure they are, but I think they are still better than putting everything on some cloud service. And at least Synology also has a good track record when it comes to security, QNAP not so much, from what I hear…

1 Like

Yes, it is worth it. But I’m an enthousiast and use it for multiple purposes.

It also saves me time: I have used Microsoft 365 for years but that irritated me more and more. Even though you pay for it they still use it for data surveillance. And it is also time-consuming because they roll out new features that you don’t need every month and they roll them out set as enabled. Working with it is like shooting at a moving target. You keep disabling stuff that only distracts you from your work.

Another reason to set up my own server: I have a lot of data and with shared hosting or VPS at commercial providers storage is expensive, in the order of € 0,50 per GB/month.

Synology DSM is based on GNU/Linux, but heavily modified with closed components. I don’t use any of their proprietary packages. Docker is open source and I’m always free to move the container(contents) elsewhere. I’m not an open source purist BTW, I just want to stay in control of my own data and don’t want to be locked in.

Thank you !.
I fully agree with all you say …
I know windows well Linux very little !
I know Nothing of php sql or apache .
I read a little some of the manuals.
And I’ve had great fun and learned loads .
Often having to jump to Google to work out what Linux commands I need .
I downloaded the package for virtual box that I run on windows10.
I had a couple of issues I could not find in the newsgroup … But after asking the community was pointed in lots of directions for help …
I eventually got it all up and running …
“Read all the manuals and learn all the midules” some people are so pompous and arrogant …lol
I’m going to try a dedicated pc with ubuntu… I’m sure this will be more of a challenge but that’s half the fun …
Your words inspire me to keep trying and learning …
I thank you !