LocalHake

Tutorial

Nextcloud - Post Install

A comprehensive guide for post-installation steps after setting up Nextcloud on Proxmox, including user management, SSH setup, updates, maintenance window, and common fixes.

Hake HardwarePublished Updated ~10 minintermediate

This post contains paid links (affiliate) — how that works.


▶ Watch this build on YouTube
Contents

Overview

This page provides a comprehensive guide for post-installation steps after setting up Nextcloud on Proxmox. It includes various configurations and optimizations to enhance the performance and security of your Nextcloud instance.

Before starting, you should have Nextcloud installed on Proxmox using either the Helper Script or TurnKey Linux method.

User Management and SSH (TurnKey Linux)

Although Nextcloud can be managed via the Console in the Proxmox GUI, it is much easier to SSH into the VM via a non-root user and execute commands.

When TKL first boots up, the appliance services will be showing. Press enter to Quit to log in with the root user.

TurnKey Linux Nextcloud appliance services screen

Login with root and the password that was set during installation. Once logged in, install sudo so that the new user can perform admin tasks:

bash
apt update && apt install sudo

Next, add the new user:

bash
adduser --home /var/www <username>

Due to how TKL is set up, there may be some minor permission issues

Adduser command output with home directory warning

Add the user to the following groups:

bash
usermod -aG sudo,www-data <username>

Fix the ownership:

bash
chown -R www-data:www-data /var/www

Set directories to 775:

bash
find /var/www -type d -exec chmod 775 {} \;

Set files to 664:

bash
find /var/www -type f -exec chmod 664 {} \;

The newly created user can now be logged in to via SSH.

SSH login to Nextcloud TurnKey Linux

If you are looking for a nice SSH client, check out Termius

Update Nextcloud

Navigate to the Nextcloud web interface via the IP address shown in the console.

Nextcloud login page

Once logged in, locate the A icon in the top right corner and click it, then select Administrative settings

Nextcloud Administration settings menu

Scroll down to the Update section and click Open updater to begin the update process.

Nextcloud Open updater button

When the updater loads, click Start update. Once ready to apply:

Nextcloud disable maintenance mode button

Click it to begin applying the update. Press the Start update button:

Nextcloud Start update confirmation page

This process will need to be repeated until all the updates are applied. The updater will only update to the next major version (ie. 29>30>31).

Set Maintenance Window

bash
sudo turnkey-occ config:system:set maintenance_window_start --type=integer --value=3
Set maintenance window via turnkey-occ

Repair Mimetypes

bash
sudo turnkey-occ maintenance:repair --include-expensive

Adding Missing Indices

bash
sudo turnkey-occ db:add-missing-indices

Set Default Phone Region

bash
sudo nano /var/www/nextcloud/config/config.php

Then add:

text
  'default_phone_region' => 'US',
Nextcloud config.php with default_phone_region set to US

CRON Not Running

bash
sudo crontab -u www-data -e

Then add this line to the bottom:

text
*/5  *  *  *  * php -f /var/www/nextcloud/cron.php

Save with Ctrl+X, Y, Enter.

Crontab entry for Nextcloud cron.php

OPCache Interned Strings Buffer

bash
sudo nano /etc/php/8.2/fpm/php.ini

Search for interned_strings_buffer and set it to 8.

PHP opcache.interned_strings_buffer set to 8

Restart apache2:

bash
sudo systemctl restart apache2

Gear used