So far my experience with Nextcloud has been that it is a pain in the arse to install, and once it’s installed is slow as anything. Literally couldn’t run it on my pi 3b, now got it up and running pretty nicely on a NUC but it’s still not great. Have caching set up.

I have the notes app installed on my android phone and I can never used rich text editing because it gives timeout error.

This shouldn’t be this complicated. All I want is to de-Google my documents and notes, and self-host my kanban. I don’t really need the rest though it’s nice to have the options.

Do people use alternatives? Am I doing something completely wrong? I set it up using nginx which I know is not supported, but the alternative using Docker AIO didn’t allow me to use custom port easily.

28 points

I seriously suggest you give Nextcloud another go, this time under Docker. Very simple to do.

Save the following in a new folder as docker-compose.yml

version: '3'

volumes:
  db:

services:

  nextcloud-app:
    image: nextcloud
    container_name: nextcloud-app
    restart: always
    volumes:
      - ./data:/var/www/html
    environment:
      - MYSQL_PASSWORD=changeme
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=nextcloud-db
    ports:
      - "80:80"
    links:
      - nextcloud-db

  nextcloud-db:
    image: mariadb
    container_name: nextcloud-db
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=changeme
      - MYSQL_PASSWORD=changeme
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

run this command in the folder -

docker-compose up -d

open http://localhost

permalink
report
reply
18 points

I suspect nextcloud having performance issues with slow Disk IO. With rootless containers I had a much worse performance than rootfull. Also using MySQL Backend instead of SQLite did speedup the performance.

Nevertheless I have the same problems with nextcloud as you stated. Pretty much not as usable as I thought.

permalink
report
reply
5 points

It’s on a SATA drive, albeit hard drive not ssd and I’m using mariadb. Everybody seems to suggest I need a beefier server but as a developer myself, the functionality of the software doesn’t seem to warrant anything more powerful.

permalink
report
parent
reply
12 points
*

Software config optimizations help a little bit but my biggest improvement was moving the DB to SSD. Spinning disks are great for capacity but not for DB performance. Random I/O is a big factor for them and those drives drop in performance so fast for that type of I/O due to physically spinning media.

I started out using Owncloud and later switched to Nextcloud once that fork was stable. For all my uses it has always needed beefy hardware to run well but I definitely have way more junk files in synced folders than I should & rarely clean things up.

permalink
report
parent
reply
4 points

Try moving the database at least on a SSD, and enable Redis caching.

permalink
report
parent
reply
1 point

How much memory? I think nextcloud wants around 8gb to run happily (ymmv). I’ve tried it with smaller sizes and ran into issues.

permalink
report
parent
reply
3 points

Yes I have 8gb of ram, but it seems insane that it needs that much considering what it is doing.

permalink
report
parent
reply
1 point

I think nextcloud wants around 8gb to run happily (ymmv).

As a developer myself, where did it go wrong?

permalink
report
parent
reply
15 points

Just want to say that I’ve been there. There was a time my Nextcloud install was incredibly slow. Fortunately (or unfortunately?), it is featureful enough and widely supported that once you figure this issue out, it is a nice service to keep running.

For me, adding Redis was essential. It doesn’t really make sense to me why (nothing I do on Nextcloud is intensive or data heavy) but it has greatly improved the performance of my app.

My entire setup is a containerized Nextcloud, Nextcloud Cron, MariaDB (if I knew Postgres was an option, I would’ve chosen that), and Redis:

version: '2'
services:
  nextcloud:
    container_name: nextcloud
    image: nextcloud:27-apache
    restart: unless-stopped
    environment:
      - MYSQL_PASSWORD=nextcloud
      - MYSQL_HOST=db
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    labels:
      - 'public-service=true'
      - 'traefik.enable=true'
      - 'traefik.http.routers.cloud.rule=Host(`nextcloud.some.domain`)'
      - 'traefik.http.routers.cloud.tls=true'
      - 'traefik.http.services.cloud.loadbalancer.server.port=80'
    volumes:
      - /some/data/dir/nextcloud/data:/var/www/html
      - /some/external/dir:/wew:ro

  nextcloud-cron:
    image: nextcloud:27-apache
    restart: unless-stopped
    command: [/cron.sh]
    environment:
      - MYSQL_HOST=db
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=nextcloud
    volumes:
      - /some/data/dir/nextcloud/data:/var/www/html
      - /some/external/dir/:/wew:ro

  db:
    image: mariadb:10.4
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: nextcloud
      MYSQL_USER: nextcloud
      MYSQL_ROOT_PASSWORD: nextcloud
    volumes:
      - /some/data/dir/nextcloud/db:/var/lib/mysql

  mysqldump:
    image: mariadb:10.4
    depends_on: [db]
    # restart: never # cronjob
    labels:
      - 'cron.schedule=0 0 8 * * ?'
    entrypoint: [mysqldump, -h, db, -u, nextcloud, -pnextcloud, --all-databases, -r, /out/nextcloud.sql]
    user: root
    volumes:
      - /some/data/dir/nextcloud/db-dump:/out

  redis:
    image: redis
    restart: unless-stopped
permalink
report
reply
6 points

For what it’s worth you can convert the database to postgres if you want. I tried it out a few weeks ago and went flawlessly.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/db_conversion.html

permalink
report
parent
reply
1 point

I’ll try this next time I need to restore the DB from backup, cheers!

permalink
report
parent
reply
4 points

Yes, redis should be part of the standard install. Not doing it is just setting yourself up for disappointment.

Also I believe postgress has better performance than mariadb so no reason not to use that if you are setting it up from scratch.

permalink
report
parent
reply
3 points

Pg has significantly better performance in a smaller self hosted environment. Notably because you’re doing a balance of reading and writing, or mostly writing since data changes regularly. For large scale operations where reading data is the primary use, MariaDB/MySQL is faster.

permalink
report
parent
reply
3 points

How is NC using redis? I can’t see any links from the NC container

permalink
report
parent
reply
4 points

I configured it in config.php directly, probably following https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id2

  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
permalink
report
parent
reply
1 point

Thanks!

permalink
report
parent
reply
1 point

Can I ask why the separate NC container for cron? Also, I presume the mysqldump container is for easy db backups?

permalink
report
parent
reply
4 points

The separate cron container made the most sense to me. Other variants “work” but imo are mostly workarounds to avoid setting up a real cronjob. Beyond this I have no real reason, nor can I vouch that is is more or less performant than others.

Yes, the mysqldump container is for easier restores. It’s much easier to restore from a .sql file than a raw data dir that was copied while the DB was running ;) (speaking from experience…)

permalink
report
parent
reply
14 points

Nextcloud is not easy to setup, that´s right, but it is not this complicated. Use Postgres as database, it is faster than MySQL. Install Redis as Cache and configure PHP Cache too. This will speedup the most. I use nextcloud installed directly on the host, no docker. Another small guide is here for Postgres and Apache

permalink
report
reply
7 points

For speed Seafile absolutely smokes Nextcloud.

If you create an account they’ll give a pro license (limited to 3 users) for free. Or you can stick with the always free community edition which works great too.

permalink
report
reply
4 points

I use Syncthing for my files, I don’t need a Web ui so it’s great and handles huge directories easily.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 4.9K

    Monthly active users

  • 3.5K

    Posts

  • 75K

    Comments