How to Install Nextcloud on Proxmox

  • Post author:WunderTech
  • Post published:July 21, 2023
  • Post last modified:October 18, 2024
  • Post category:Proxmox
  • Reading time:13 mins read

In this tutorial, we’re going to look at how to install Nextcloud on Proxmox.

Nextcloud is one of the most popular applications you can use to provide local functionality similar to cloud offerings like Dropbox, Office 365, or Google Cloud. Nextcloud runs really well on Docker, and if you’re using Proxmox, you can easily configure an LXC Container to run Docker, then install Nextcloud on top of it. From a resource usage perspective, this is my favorite way of running Nextcloud on Proxmox.

What is Nextcloud?

Nextcloud is an open-source software suite that provides online data storage and applications like calendars, contacts, and photo galleries. It’s a self-hosted solution, meaning that instead of relying on third-party cloud services, users install and run it on their own servers.

The primary function of Nextcloud is file hosting but with user-controlled privacy. It allows users to store files, sync them between devices, and share them with others. Users can extend its functionality through tons of applications available in its app store. We’ll look at how to install Nextcloud on Proxmox below.

Configure Docker on Proxmox

You can use any Linux distribution you’d like, but we’ll be utilizing Debian 11 below to install Docker.

1. After logging into Proxmox, select the storage location you want to store the container template, select CT Templates, then select Templates.

container template.

2. Search for Debian, select debian-11-standard, and Download.

debian 11.

3. After the template downloads, select Create CT to create a new container.

creating a new container.

4. Enter a hostname and enter the Password. This password is used to log in to the root user account. When you’re done configuring everything, select Next.

creating a docker LXC container.

5. Select the Template, then select Next to proceed.

selecting the debian 11 template.

6. Enter a Disk Size for this LXC container, then select Next. Since this is for Nextcloud, you might want to set it for a bigger total size than I have below!

entering a disk size.

7. Enter the Cores for the CPU, then select Next.

selecting CPU cores.

8. Set the total Memory you’d like to use for this container, then select Next.

NOTE: This is the limit that this container can use.

setting total memory for the container.

9. In the Network section, select DHCP for IPv4 and IPv6 (you can also set them manually if desired), then select Next until you get to Confirm.

NOTE: The DNS section can be configured as well if you’d like.

setting up the network settings.

10. Confirm the settings, then create the container by selecting Finish!

finishing configuring the LXC container.

11. In the settings of the LXC Container that was just created, select Options, Edit, then Features.

accessing the containers features.

12. Enable the keyctl setting, then select OK. You can now start the container!

enabling keyctl for the container.

13. After the container starts, log in with the username root and the password specified in step four. Then, run the commands below, in order, to install Docker, then Portainer (which we’ll be using to install Nextcloud).

apt update && apt upgrade -y
apt install curl -y
curl -sSL https://get.docker.com/ | sh
docker run --restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

14. Access Portainer by navigating to the container IP address and port 9000. If you aren’t sure what the IP address of the container is, run the command below to get the IP address.

ip addr
http://[CONTAINER_IP]:9000

Docker Container Configuration: Nextcloud on Proxmox

Now that Docker and Portainer have been installed, we can install Nextcloud on Proxmox.

1. After Portainer has been opened, select Stacks, and Add Stack to create a new stack. We will use a Stack to create the Nextcloud container and database.

portainer stacks view.

2. Create the stack and set the name as nextcloud.

how to create a stack in portainer.

3. Paste the contents below into the web editor. A few notes:

  • You can adjust the volume details if you’d like. Keep in mind that these paths are the locations where all important Nextcloud data will be stored. If you want to back up or migrate this container, you must use these folders! For this reason, you might want to configure a different location!
  • You should update the passwords below. Make sure the MYSQL_PASSWORD matches for the Database and Nextcloud container.
version: '2'

services:
  db:
    image: mariadb:10.5
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - /var/lib/docker/volumes/Nextcloud_Database:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - /var/lib/docker/volumes/Nextcloud_Application:/var/www/html
    environment:
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
web editor of nextcloud stack. how to install nextcloud on proxmox.

4. After all changes have been made, select Deploy the stack at the bottom to create the two containers.

portainer deploy stack button.

5. The container should now be created! You’ll have one for the Nextcloud container and one for the database.

portainer container list.

Nextcloud Application Configuration

Now that the container has been created, we can configure Nextcloud.

1. Navigate to your Unraid server’s IP address and port 8080. Set up a username and password at the first screen, then select Install.

http://[CONTAINER_IP]:8080
nextcloud install screen.

2. Install the recommended apps or skip this step. If you choose to install apps, this step will take a few minutes.

nextcloud recommended apps.

3. Nextcloud will now be ready to use!

nextcloud dashboard.

Conclusion: How to Install Nextcloud on Proxmox

This tutorial looks at how to install Nextcloud on Proxmox. If you use Portainer and utilize Docker Compose, the process is pretty straightforward. However, it’s important to have Docker set up and configured already in Proxmox. There is also an individual, all-in-one Nextcloud container you can use (which won’t have a separate application/database), but since I’ve used this setup process for various other Nextcloud configurations, this is what I feel comfortable recommending.

Please ensure that the volumes configured are backed up properly as they will hold all Nextcloud data. As mentioned above, if you ever decide to move Nextcloud to a new server, the data that exists in these folders is what must be migrated.

Thanks for checking out the tutorial on how to install Nextcloud on Proxmox. If you have any questions on how to install Nextcloud on Proxmox, please leave them in the comments!

WunderTech

WunderTech is a website that provides tutorials and guides on various NAS, server, networking, and infrastructure-related topics. WunderTech is maintained by Frank Joseph, an IT professional with 14+ years of experience in corporate IT and application management. He focuses on sharing his experience with others on his WunderTech website and YouTube page. Frank holds a Bachelor of Science in Computer Information Systems and a master of Business Administration (MBA).

This Post Has 2 Comments

  1. RET

    Thanks a lot for the tutorial, but i want to add redis to nextcloud with mariadb and the db service is restarting everytime without redis everything works fine…

    1. WunderTech

      Have you checked the Redis logs? Does it give any hint to why it’s crashing?

Comments are closed.