Sign inSign up

schleyk/nextcloud

By schleyk

Updated 3 days ago

Nextcloud is the most deployed on-premises file share and collaboration platform.

Image
Databases & storage
1

10K+

schleyk/nextcloud repository overview

Docker Pulls

schleyk/nextcloud

Features
  • Support for Nextcloud version 32 / 33 / 34
  • Based on Alpine Linux 3.23.
  • Bundled with nginx and PHP 8.3 (schleyk/nginx-php image).
  • Automatic installation using environment variables.
  • Package integrity (SHA512) and authenticity (PGP) checked during building process.
  • Data and apps persistence.
  • OPCache (opcocde), APCu (local) installed and configured.
  • system cron task running.
  • MySQL, PostgreSQL (server not built-in) and sqlite3 support.
  • OnlyOffice support (server not built-in).
  • Nextcloud Office with Collabora Online (server not built-in).
  • ClamAV antivirus support (not built-in).
  • Redis, FTP, SMB, LDAP(s), IMAP, SMTP support.
  • GNU Libiconv for php iconv extension (avoiding errors with some apps).
  • No root processes. Never.
  • Environment variables provided (see below).

For security reasons, you should occasionally update the container, even if you have the latest version of Nextcloud.

Build-time variables
  • NEXTCLOUD_VERSION : version of nextcloud
  • GPG_nextcloud : signing key fingerprint
Environment variables
  • UID : nextcloud user id (default : 991)
  • GID : nextcloud group id (default : 991)
  • UPLOAD_MAX_SIZE : maximum upload size (default : 10G)
  • APC_SHM_SIZE : apc memory size (default : 128M)
  • OPCACHE_MEM_SIZE : opcache memory size in megabytes (default : 2048)
  • MEMORY_LIMIT : php memory limit (default : 512M)
  • CRON_PERIOD : time interval between two cron tasks (default : 5m)
  • CRON_MEMORY_LIMIT : memory limit for PHP when executing cronjobs (default : 1024m)
  • TZ : the system/log timezone (default : Etc/UTC)
  • ADMIN_USER : username of the admin account (default : none, web configuration)
  • ADMIN_PASSWORD : password of the admin account (default : none, web configuration)
  • DOMAIN : domain to use during the setup (default : localhost)
  • TRUSTED_PROXIES set reverse proxy like 10.0.0.0/8 127.0.0.0/8 192.168.0.0/16
  • DB_TYPE : database type (sqlite3, mysql or pgsql) (default : sqlite3)
  • DB_NAME : name of database (default : none)
  • DB_USER : username for database (default : none)
  • DB_PASSWORD : password for database user (default : none)
  • DB_HOST : database host (default : none)

Don't forget to use a strong password for the admin account!

Port
  • 8888 : HTTP Nextcloud port.
Volumes
  • /data : Nextcloud data.
  • /config : config.php location.
  • /apps2 : Nextcloud downloaded apps.
  • /nextcloud/themes : Nextcloud themes location.
  • /php/session : php session files.
  • /etc/ssl/private : Internal Root-CA store for LDAPs.
Database

Basically, you can use a database instance running on the host or any other machine. An easier solution is to use an external database container. I suggest you to use MariaDB, which is a reliable database server. You can use the official mariadb image available on Docker Hub to create a database container, which must be linked to the Nextcloud container. PostgreSQL can also be used.

Setup

Pull the image and create a container. /docker can be anywhere on your host, this is just an example. Change MYSQL_ROOT_PASSWORD and MYSQL_PASSWORD values (mariadb). You may also want to change UID and GID for Nextcloud, as well as other variables (see Environment Variables).

You are not obliged to use ADMIN_USER and ADMIN_PASSWORD. If these variables are not provided, you'll be able to configure your admin acccount from your browser.

Now you have to use a reverse proxy in order to access to your container through Internet, steps and details are available at the end of the README.md. And that's it! Since you already configured Nextcloud through setting environment variables, there's no setup page.

Configure

In the admin panel, you should switch from AJAX cron to cron (system cron).

Update

Pull a newer image, then recreate the container as you did before (Setup step). None of your data will be lost since you're using external volumes. If Nextcloud performed a full upgrade, your apps could be disabled, enable them again (starting with 12.0.x, your apps are automatically enabled after an upgrade).

How to configure Redis

Redis can be used for distributed and file locking cache, alongside with APCu (local cache), thus making Nextcloud even more faster. As PHP redis extension is already included, all you have to is to deploy a redis server (you can do as above with docker-compose) and bind it to nextcloud in your config.php file :

'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => array(
   'host' => 'redis',
   'port' => 6379,
   ),
How to configure Nextant

You will have to deploy a Solr server, I've shown an example above with docker-compose. Once Nextant app is installed, go to "additional settings" in your admin pannel and use http://solr:8983/solr as "Adress of your Solr Servlet". There you go!

Tip : how to use occ command

There is a script for that, so you shouldn't bother to log into the container, set the right permissions, and so on. Just use docker-compose exec nextcloud occ command.

Tag summary

Content type

Image

Digest

sha256:b05df6766

Size

337.4 MB

Last updated

3 days ago

docker pull schleyk/nextcloud