Need Encryption Solution for ZimaOS + Nextcloud 33.0.5 - Protect Against Server Access

Hi :wave:

I’m currently improving the security of my Nextcloud instance and want to enable encryption.

Current setup:

- ZimaOS

- Nextcloud 33.0.5 (bigbeartechworld/big-bear-nextcloud-with-smbclient:33.0.5)

Problem with default Nextcloud encryption:

- Major performance losses (reported)

- Some apps incompatible with it

What I want:

- Encrypt data without major drawbacks (no/perf impact, app compatibility)

- Goal: Even if an attacker accesses the server, they can’t retrieve any readable data (external attacks)

Question:

What encryption solution do you recommend for my setup?

If anyone has advice or real-world experience, I’d be glad to hear it! :wink:

Thanks in advance :pray:

This is a challenging question to answer without knowing far more about your situation.

Before proceeding though, have you read through the recently rewritten Nextcloud Admin Manual’s Encryption chapter? It attempts to give some context for these decisions.

Thanks for the link! I read the encryption guide and it confirms what I suspected:

From the docs:

- “SSE does not protect data from a compromised Nextcloud server or malicious administrator. Use E2EE for this threat.”

- “If you need to prevent admins from accessing files, use E2EE.”

My issue with SSE:

- Major performance loss (reported)

- Some apps incompatible

My constraint:

- Need Web UI (E2EE not possible, requires desktop/mobile only)

My goal:

- Encrypt so attacker can’t retrieve readable data if he accesses the server

- No performance loss or incompatible applications

Questions:

- Is there another encryption solution for physical server protection without SSE drawbacks?

Any recommendations?

What is your goal?

Physical server protection or protection from outside attacker (i.e. someone breaking into the server remotely)?

It would mainly be to protect against external attacks.
At the moment, if an attacker gains unauthorized access to the server, they could browse the data directory and potentially access user files, which does not feel very secure. I already have SSL/TLS enabled with HTTPS, but I would also like to encrypt the stored user data.

However, Nextcloud’s built-in server-side encryption is not ideal for my use case, as it introduces performance overhead and causes compatibility issues with certain apps.

As for physical drive theft, I will need to wait until my operating system supports LUKS encryption.

I think what you want to achieve is not feasible.

See, if someone breaks into the server and gains root access you’re screwed even if you use SSE. Because the encryption keys are stored on the server. Even if you had them stored somewhere else, given the fact that your attacker has gained root access, what would it stop him to impersonate the application (i.e. Nextcloud) to gain access to the encryption keys?

The only protection as you want it against an external attack is E2E encryption. But you ruled that option out in a previous post.

Regarding security of your setup in General: You’re running a Chinese Linux distribution (with custom kernel patches) and you’re using a Nextcloud Docker image curated by a Youtuber who spews out a massive amount of preconfigured Docker images. If I were you I’d migrate my setup to a more trustworthy environment.

Okay, no problem. Thanks anyway for taking the time to look.

Yes, I plan to migrate to another operating system quickly; I know it’s not optimal at the moment. Do you think it would be a good idea to migrate to OpenMediaVault?

Thanks anyway :slight_smile:

Just to fill in a bit of a background, the server-side encryption is designed when your server uses a storage backend and you cannot or do not want to trust this operator. Then the data is encrypted on your server and stored encrypted in the storage backend. Since your server is handling all the encryption/decryption, someone with access to it can temper with that.

Debian/Ubuntu-based systems support LUKS and other options. Regarding which flavor of it or which kind of system in detail, that depends a lot on you and your preferences.

OpenMediaVault is based on debian but does much more than just Nextcloud. If you are just interested in running Nextcloud, then this is overkill. If you’d like to have a traditional NAS in your home network with Nextcloud on top, then this might be a good idea. Nextcloud announce a long time ago that they are partnering with TrueNAS:

I have no experience myself to tell you which is better integrated.

your link is outdated. It references to Truesnas Core, which shouldn’t be used for new deployments anymore.

Here’s the new link: Nextcloud | TrueNAS Apps Market

It’s basically a IXsystems curated set of Docker images (pgsql, nginx, redis, nextcloud).

Okay, thank you very much for the clarification. I installed OMV earlier; all that’s left is to configure Nextcloud so it runs properly.

I’m going to do this with Docker/Portainer on OMV.

I kept my old data, so I just need to reconfigure the paths and create the folders like redis and db (for the db I have my .sql file ready to be imported).

Thank you for your advice. :smiling_face: