For those looking to securely store their personal data in a centraliyed way, Nextcloud is an excellent choice. When paired with the Proxmox virtualiyation platform, it enables the creation of a robust and flexible cloud infrastructure.

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 virtualisation, enabling efficient management of virtual machines and containers. The combination of Nextcloud and Proxmox provides a flexible and secure way to build a cloud infrastructure for personal or business use.

The requirement for installing Nextcloud on Proxmox

Before you can install Nextcloud on Proxmox, there are some basic requirements to meet. First, you will need a Proxmox server (version 6 or higher is recommended) 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 recommended. Additionally, make sure you have sufficient disk space for your data – the specific amount will depend heavily on your individual 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 additional 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 maintenance
  • Easily add apps and online office tools

Step 1: Create a virtual machine or container

First, you need to create an environment for installing 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 (recommended: 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 previously uploaded.
  3. Configure CPU, RAM, and storage space according to your requirements.
  4. Install the operating system in the VM.

Step 2: Prepare the system

Once you have created the environment, you can log into the system via SSH or the Proxmox console. Before installing Nextcloud, you should prepare your system accordingly. 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 dependencies. 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 preparation 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 installation of Nextcloud. First, download the latest version of Nextcloud:

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

Next, extract the downloaded 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 permissions 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 configured Apache web server. First, create a configuration file that controls how the Apache web server handles requests to your Nextcloud installation:

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

Add the following content to the configuration 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 installation. Now, activate the configuration 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 installation specified in the configuration file in a browser of your choice. Follow the setup wizard to configure the database connection and the admin user.

Was this article helpful?
Go to Main Menu