For those looking to securely store their personal data in a cent­rali­yed way, Nextcloud is an excellent choice. When paired with the Proxmox vir­tu­aliy­ation platform, it enables the creation of a robust and flexible cloud in­fra­struc­ture.

What are Proxmox and Nextcloud?

Nextcloud is an open-source cloud solution that allows you to securely store and share files, calendars, contacts, and much more. On the other hand, Proxmox is a powerful platform for vir­tu­al­isa­tion, enabling efficient man­age­ment of virtual machines and con­tain­ers. The com­bin­a­tion of Nextcloud and Proxmox provides a flexible and secure way to build a cloud in­fra­struc­ture for personal or business use.

The re­quire­ment for in­stalling Nextcloud on Proxmox

Before you can install Nextcloud on Proxmox, there are some basic re­quire­ments to meet. First, you will need a Proxmox server (version 6 or higher is re­com­men­ded) and access to the Proxmox web interface.

For the virtual machine or container where Nextcloud will run, you will also need at least 2 CPU cores and 2 GB of RAM. For larger user groups, 4 GB of RAM or more is re­com­men­ded. Ad­di­tion­ally, make sure you have suf­fi­cient disk space for your data – the specific amount will depend heavily on your in­di­vidu­al use case.

Note

Nextcloud can be installed not only on Proxmox, but also through other methods. To explore more ways to use the cloud, take a look at our ad­di­tion­al articles:

How to install Nextcloud on Proxmox step by step

There are several ways to install Nextcloud on Proxmox. The guide shown here is just one of those methods.

Managed Nextcloud
Cloud storage that puts you in control
  • Keep your data safe with industry-leading security
  • Save time on updates and main­ten­ance
  • Easily add apps and online office tools

Step 1: Create a virtual machine or container

First, you need to create an en­vir­on­ment for in­stalling Nextcloud. You can either create a container with LXC or a virtual machine for this purpose.

LXC container

  1. Navigate to ‘Create CT’ in the Proxmox web interface.
  2. Enter a container name and the desired resources.
  3. Select a Debian or Ubuntu template (re­com­men­ded: Ubuntu 22.04).
  4. Configure the network and disk storage. Make sure to allocate enough storage for using Nextcloud.

Virtual machine

  1. Navigate to ‘Create VM’ in the Proxmox web interface.
  2. Select an ISO image of Ubuntu Server or Debian that you have pre­vi­ously uploaded.
  3. Configure CPU, RAM, and storage space according to your re­quire­ments.
  4. Install the operating system in the VM.

Step 2: Prepare the system

Once you have created the en­vir­on­ment, you can log into the system via SSH or the Proxmox console. Before in­stalling Nextcloud, you should prepare your system ac­cord­ingly. First, update it using the following terminal command:

sudo apt update && sudo apt upgrade -y
bash

Once your system is updated, you need to install Apache, MariaDB/MySQL, PHP, and other de­pend­en­cies. You can use the following command to do so:

sudo apt install apache2 mariadb-server libapache2-mod-php php php-mysql php-curl php-xml php-mbstring php-zip unzip -y
bash

As the final pre­par­a­tion step, you can now set up your MariaDB database for Nextcloud. To do this, start the database:

sudo systemctl start mariadb
bash

Now you can set up the database with the following commands. Make sure to remember or note down your chosen secure password:

sudo mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'securepassword';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
bash

Step 3: Install Nextcloud

Now you can proceed with the in­stall­a­tion of Nextcloud. First, download the latest version of Nextcloud:

wget https://download.nextcloud.com/server/releases/latest.tar.bz2
bash

Next, extract the down­loaded files using the tar command and move them:

tar -xjf latest.tar.bz2
sudo mv nextcloud /var/www/
bash

Now, you should set the correct per­mis­sions and ownership for the Nextcloud files so that the web server software (here Apache) can work with them smoothly:

sudo chown -R www-data:www-data /var/www/nextcloud
sudo chmod -R 750 /var/www/nextcloud
bash

Step 4: Configure Apache

For Nextcloud to work on Proxmox, you need a properly con­figured Apache web server. First, create a con­fig­ur­a­tion file that controls how the Apache web server handles requests to your Nextcloud in­stall­a­tion:

sudo nano /etc/apache2/sites-available/nextcloud.conf
bash

Add the following content to the con­fig­ur­a­tion file you just created:

<VirtualHost *:80>
    ServerName your-domain.com
    DocumentRoot /var/www/nextcloud
    <Directory /var/www/nextcloud>
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
    CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
</VirtualHost>
bash

Make sure to insert the correct domain under which you want to access your Nextcloud in­stall­a­tion. Now, activate the con­fig­ur­a­tion and the required modules with the following terminal commands and restart Apache:

sudo a2ensite nextcloud.conf
sudo a2enmod rewrite headers env dir mime
sudo systemctl restart apache2
bash

Step 5: Set up Nextcloud

Now you can set up your Nextcloud. Visit the address of your Nextcloud in­stall­a­tion specified in the con­fig­ur­a­tion file in a browser of your choice. Follow the setup wizard to configure the database con­nec­tion and the admin user.

Go to Main Menu