# How to install Nextcloud on Proxmox step by step

For those looking to securely store their personal data in a centraliyed way, Nextcloud is an excellent choice. When paired with the [Proxmox](https://www.ionos.co.uk/digitalguide/server/know-how/proxmox/) virtualiyation platform, it enables the creation of a robust and flexible cloud infrastructure.

## What are Proxmox and Nextcloud?

[Nextcloud](https://www.ionos.co.uk/digitalguide/server/tools/what-is-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](https://www.ionos.co.uk/digitalguide/server/configuration/virtualisation/), enabling efficient management of [virtual machines](https://www.ionos.co.uk/digitalguide/server/know-how/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](https://www.ionos.co.uk/digitalguide/server/know-how/what-is-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:

- [Install Nextcloud on Ubuntu 22.04](https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-ubuntu-2204/)
- [Install Nextcloud on Debian](https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-debian-12/)
- [Install Nextcloud on Kubernetes](https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-kubernetes/)
- [Nextcloud Installation with Docker](https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-installation-with-docker/)

## 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.

### 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](https://www.ionos.co.uk/digitalguide/server/know-how/what-is-lxc-linux-containers/) 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](https://www.ionos.co.uk/digitalguide/server/know-how/ubuntu-the-linux-system-for-everyone/) 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:

```bash
sudo apt update && sudo apt upgrade -y
```

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:

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

As the final preparation step, you can now set up your MariaDB database for Nextcloud. To do this, start the database:

```bash
sudo systemctl start mariadb
```

Now you can set up the database with the following commands. Make sure to remember or note down your chosen [secure password](https://www.ionos.co.uk/digitalguide/server/security/protect-sensitive-data-with-a-strong-password/):

```bash
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;
```

### Step 3: Install Nextcloud

Now you can proceed with the installation of Nextcloud. First, download the latest version of Nextcloud:

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

Next, extract the downloaded files using the `tar` command and move them:

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

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:

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

### 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:

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

Add the following content to the configuration file you just created:

```bash
<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>
```

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:

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

### 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.


This is a markdown version of: [https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-proxmox/](https://www.ionos.co.uk/digitalguide/server/configuration/nextcloud-proxmox/) for AI/LLM consumption.