Installing Nextcloud on Your VPS with HestiaCP

Last updated on March 18th, 2024 at 06:13 am.

Watch the video below for a step-by-step guide on how to install Nextcloud on HestiaCP with Nginx server. This guide can work with any VPS provider.

How to install Nextcloud using HestiaCP Nginx Vultr VPS DigitalOcean Contabo or any VPS

Hi there, and welcome to this tutorial on how to install Nextcloud on your VPS using HestiaCP.

Here is a summary of everything done in the above video

Prerequisites

Before we begin, here’s what you’ll need:

Choosing a VPS Provider

In this demonstration, I will be using Vultr for this demonstration. If you prefer DigitalOcean or other providers like Contabo, Hetzner, or OVH, feel free to use those. Links with free credits are provided for your convenience.

Step 1: Log into Your VPS

Make sure you are logged into your VPS via SSH. If you’re not using the root user, remember to use sudo for the following commands. You need SSH access to perform various tasks such as installing HestiaCP. Here is the latest video for deploying Ubuntu with an SSH Key on Vultr.

ssh your_username@your_server_ip

Step 2: Update Your System

Let’s ensure everything is up-to-date by running:

sudo apt update && sudo apt upgrade -y

Step 3: Download HestiaCP Installation Script

We’ll use HestiaCP, a free open-source control panel, to install Nextcloud. First, download the installation script. You can customize your installation script by going to this install page on Hestia.

cd /tmp
wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

Step 4: Generate HestiaCP Installation Script

Next, let’s generate the installation script based on our settings below. We’ll choose Nginx and PHP-FPM for our setup:

  • Port: 2083
  • Apache – no
  • Hostname: pan.example.com (Use your domain)
  • Email: (Your email)
  • Password: YourPassword

Our final install script settings will be as follows:

sudo bash hst-install.sh --port 2083 --hostname pan.example.com --email  --apache no --multiphp yes --force

Step 5: Install HestiaCP

Copy the script you have generated from the Hestia install page to install HestiaCP with the provided settings:

sudo bash hst-install.sh --port 2083 --hostname pan.example.com --email  --apache no --multiphp yes --force

Follow the prompts, and once the installation is complete, log into HestiaCP using the provided URL, username, and password. Once Hestia installation is complete, the HestiaCP server login url and username will be output on the terminal.

At any point if you feel lost, just watch the step-by-step video embedded above.

Step 6: Configure PHP Settings

Note that we’ll install Nextcloud with PHP 8.2. Therefore, change PHP settings for PHP8.2.

Inside HestiaCP, navigate to PHP 8.2 Settings and adjust the following:

  • Memory limit: 512M
  • Post max size: Leave as default

Save the new settings.

Step 7: Create a New HestiaCP User

Create a new user in HestiaCP to manage your domains and services:

Click on Add new user to create a new user of your choice. In my example my user was created with these options:

  • Username: user99 (Choose your username)
  • Email: (Your email)
  • Password: YourPassword

Step 8: Add Your Domain’s DNS settings

In my setup I used Cloudflare to handle DNS. Add your domain to Cloudflare and add the A record for the subdomain where you will install Nextcloud. Here is how to use Cloudflare for DNS with your Hestia panel.

Under DNS settings, add your domain where you’ll install Nextcloud. Ensure you’ve added the necessary DNS records (A records, CNAME, etc.).

If you’d like to access Hestia via your hostname, add the A record for it on Cloudflare.

Step 9: Add domain to hestia and Generate SSL Certificate

If you are logged in as admin, click on the user you created earlier. You cannot add your websites as admin, only as another new user.

Click on Web and add the domain/subdomain where you will install Nextcloud.

Before attempting to enable SSL, ensure your domain is pointing to your IP using an A record.

Enable SSL for your domain using Let’s Encrypt. Enable automatic HTTPS redirection for added security.

Step 10: Installing Nextcloud on HestiaCP

In HestiaCP, go to your domain/subdomain settings and select “Quick Install App.”

Choose Nextcloud setup. Create a user for Nextcloud (e.g., user99) and generate a password. You can leave the db settings as they are, and they’ll be automatically generated.

Ensure your PHP version is set as PHP 8.2 . If you are reading this after 2024, check which is the latest recommended PHP version for Nextcloud by Nextcloud System recommendation.

Step 11: Finalize Installation

If the installation was successful, you will see a message telling you it was successful.

Next, go to the domain where you installed it, you’ll see the Nextcloud login page. Use the credentials you set up to log in.

That’s it! You’ve successfully installed Nextcloud on your VPS using HestiaCP. Feel free to explore Nextcloud and its features. If you encounter any issues, refer back to these steps or comment on the Nextcloud install video on YouTube with your question. Thank you for following along!

Video Transcript

Hi there, and welcome to this video. In this video, you’re going to see how to install Nextcloud on your VPS using HestiaCP. HestiaCP is a free open-source control panel that has a built-in script installer/app installer, and that is what we’re going to use to install Nextcloud. It’s going to make your work really easy installing Nextcloud or any other script such as WordPress and so on.

First, you will need a server. If you don’t have a server, please feel free to support my efforts. I’m going to use Vultr for this demonstration, and I will add my Vultr link in the description. The link will come with $100 credit. You can use that to test Vultr. If you want to use DigitalOcean, I’m also going to add my link in the description. That will give you $200 credit. I will also add my Contabo and Hetzner Link, and OVH if you want to use any VPS to run Nextcloud. Please consider supporting me. I will put my links in the description. Thanks in advance.

I did create a video for how to get your server running on Vultr, how to log in using an SSH key, and so on. I will put the link for that video as well if you want to deploy your Vultr server. So, go ahead and log into your server. I’m already logged into mine, and I can just check if I have any updates:

apt update

“`

So, you can see I’m using the root user. But if you’re not using root, you’re going to have to use sudo. Let me upgrade the one package and enter crl L to clear the screen. Then I’m going to go to HestiaCP, and I need to generate an installation script. So, I’m not going to use Apache, I’m going to use Nginx and PHP-FPM as is recommended for anyone that is using a small server. If you have a small server (4GB and below), just use Nginx and PHP-FPM instead of using Apache. We’re going to generate our script.

So, for the port, I want to use Port 2083 because that Port is acceptable via the Cloudflare network. For hostname, I’ve already added my domain here to Cloudflare, and I’m going to use `pan.Cloudubuntu.com` as my hostname. Make sure you add the A record for the domain that you want to use as a hostname and also for the domain where you want to install Nextcloud. For me, I’m going to install it on this subdomain, so I’ve already added an A record for that. If you haven’t, make sure you do that before you start the installation. That way, the propagation can be done by the time you’re done installing HestiaCP.

I’m going to come back here, and I’m going to use my custom hostname as `pan.dot.that`. And then, for email, I can just use a sample, ``. And then for the password, I can just copy this:copy

“`

And I’m going to use that as my admin password for HestiaCP. And as I said, I’m not going to use Apache, so I’m going to disable Apache PHP. I’m going to install multiple PHP versions, this is for FTP server, `bind` is for DNS, `MariaDB` of course, database, we need that for Nextcloud, `exim` is for sending mail, and these as well are for security: `mail firewall`, `fail2ban`, `iptables`, `spam assassin`. All these just leave them installed, and then we want to force the installation. Now, we can install HestiaCP.

So, you will copy that into your VPS where you’re logged in. I want to do this inside of `/tmp`, inside of the temp directory so that it doesn’t clog my root home folder. I’m going to paste that in there. The installation script is downloaded. Now, the parameters for installing HestiaCP, let’s add this here: control shift V

“`

So, just paste the way your terminal allows you to paste. If you’re not the root user, you’ll need to add sudo on this. I’m going to press enter. You have to accept explicitly by typing in capital Y, enter. And that’s going to install Nginx, PHP, bind, exim, dovecot, and MariaDB. All this will take some time, so I’m just going to give it some time, and then we’ll come back once the installation is complete. Then log into HestiaCP and see how we can proceed with the installation.

While HestiaCP is installing, I would like to reiterate that you need to add your DNS records for the domain or the subdomain where you’ll be installing Nextcloud. So in my case, I’m going to install it here, so I’ve added an A record with the IP address of my server. You can also add `www.next` with a CNAME to `next.yourdomain`. This is going to be my hostname, and you’re going to see that the benefit of having this here is that I can access my panel using the subdomain instead of using my IP.

Let’s just wait for the installation to complete, and then we’re going to access the panel. HestiaCP is now installed, and we can access it. So you can see this is what a control panel does for you. So all these things have been installed for me. These are things that if I weren’t using a control panel, I would have to do manually by myself. So this is why a control panel is efficient and makes your work way way easier. Let me copy this: copy

“`

And I will put them here: crl V

“`

So I can access my domain, my Hestia panel using this. So here as well, I was told press any key to continue, so I can press any key to continue, and that’s going to restart the server. So if I come to an incognito window, I can go to my panel. Hopefully, the server is started. So the server is still starting, `crl L` to clear the screen. The server is not yet running, just give it time to restart.

There we go, we can now access our control panel. Now you can see I can access it using this because Cloudflare already has an SSL, and this is also using a self-generated SSL. So if you want it to work like that, you’d have to come to Cloudflare under SSL and make sure at least you’re using full protection. You can see with full SSL, you can use a self-signed certificate. If you want to use strict mode, you’d have to create a certificate using Let’s Encrypt at least. So let’s come back and log into HestiaCP. I will go into admin username as `admin` and then the password is what I set, which was that: copy

“`

Put it there, enter. There we go, you’re now in HestiaCP. And the first thing I want to do since I’m going to be installing

Nextcloud is I’m going to change some of the PHP settings. You can see you have many PHP versions here. If you feel that these are too many PHP versions, just click here on `configure`, and then, in the web server, you can uninstall various PHP versions if you feel you don’t need it. You can uninstall them. Just remember that this is going to take some time, so I’m just going to go back because I know that usually takes some time.

So once you do that, just click on `Save`, click on `Save`, and it will uninstall those PHP versions. Let me click here on `user`, and I will click back on `configuration settings`. And this is the PHP version I’m going to use with Nextcloud. So I’m just going to click on that, but usually with HestiaCP, if you change anything here, it’s going to change it for the other PHP versions. For that, let’s just do:

– Memory limit: `512` (I think that’s the recommended version)

– Post max size: I’m just going to leave it at the default

Then I’m going to save, and even before you go here, okay, we’re going to see if we experience that error. If we experience that error, we’re going to come back here and `control F` inside here, `crl F`, we need to find `PCntl`, and then we’re going to disable this while installing. If we experience that `PCntl` error, if we don’t, we’re just going to forget about this.

So let’s go back, and I’ve changed some settings for PHP, so let me just restart it:

restart

“`

PHP, and now let’s see what next we need to do. Okay, you can see we only have one user, `admin`. Usually when you get HestiaCP, the first thing you need to do is create a new user, and that is the user you’re going to use with your domains, your websites, email, and so on. So I’m just going to click here, add user. Let’s just call it `user99`, and we can call it `user`, give the name `user99` to this user. Email address: we can do ``. Of course, this is a sample, and I will give it a password. I don’t even need to copy it to save the password because I can just log in via the admin user. So anything else I need to do for this user? I don’t think so. I’m just going to leave the role as a normal user. You can make them an admin as well, but I’m going to leave it as a normal user. And then I’m going to save the details to create this user.

So if you go back to users, you’ll see that we have two users. I’m just going to click on this user to log in as that user, and then we’re going to add our domain where we are going to install Nextcloud. So I’m going to come here and into DNS, under DNS settings for that domain, I want to copy the domain name there because I don’t want to type. I’m just going to copy, and I will come back here, add a web domain, paste. I can add in DNS support. So, since I’m using Cloudflare, this is just going to generate various DNS records, and you can copy those records from here into Cloudflare, especially for email. I’m just going to click on save. You can also enable mail support if you’re going to use mail with this domain. In my case, I’m just going to click on `Save`.

And that has created the domain. But let’s go and generate an SSL certificate for that domain. So I’m going to click there, and it’s going to bring the settings for that domain. You can enable statistics for this, you can use AWStats. I will not enable web statistics for the domain. And then, I’m going to enable SSL. I will use Let’s Encrypt. I will enable automatic HTTPS redirection, and I can also enable strict mode for HTTPS under Advanced options. Let’s see what we have here. We can change the web template for Nginx and Nextcloud. You can use ownCloud, but I do believe this is going to get changed automatically when you click to install Nextcloud. You can enable FastCGI, but I’m not going to do that. And then, backend template for this, I’m going to use PHP 8.2. All these other options as well, you can turn them on and change and change the document root where your files will be. If you don’t, it’s going to go to the default location, and we’ll see where that is later. You can add additional FTP accounts, you can create FTP accounts so that you can access this domain when you do. And you don’t add the DNS records, make sure you’re using the IP as your hostname. With that, I’m going to click on `Save`. First, to generate SSL, make sure that before you click on `Save`, your DNS records have been added and they’re working properly because if they’re not, you’re going to get a 400 error, and that will mean that you’ll need to look at your DNS records.

Alright, this is a good sign, everything has saved successfully. So we can click on `web`, and we can go to the Domain just to confirm that it is working. And we can see it is working. We’re working on it, SSL is working, that’s good. Now, let’s come back to the domain and click on it. Here, this is where you can install various scripts. I’m just going to click there on `Quick Install App`, and you can see here, you can install different applications: WordPress, Laravel, and so on. I’m going to click on `Setup` for Nextcloud to install Nextcloud.

So here, I’m just going to create a user for Nextcloud, and I’m just going to use the same user, `user99`, and then I’m going to generate a password, copy the password and save it here: `user99`, and that’s the password. So the rest I will leave them as they are, they will get generated automatically, and let me save. If I experience any error, we’re going to work on it until eventually we have Nextcloud installed. So I’m going to click there on `Save`.

Alright, luckily I didn’t experience any problem, and if you follow along with me step by step the way I’ve done everything, probably you’re not going to experience any issues. But if you do, first of all, you’ll just go into your file manager and then delete everything that has already been done there. There will be files that will have already been added if you started the installation. So if you go into this domain, then you go into `public_html`, just click there and delete everything inside of `public_html`. So now if we refresh the page, we’re going to see the Nextcloud login page, and I can copy the password from there.

Why is this happening like this? Okay, just refresh. Now, entering the user, I chose `user99`, and the password: paste

“`

Login

. There you go, Nextcloud is installed. You can add Nextcloud on all your devices by installing the various apps from Google Play, App Store. We have achieved the goal of the video, and that was to install Nextcloud via HestiaCP. If you experience any errors at any point, first make sure that you’ve changed the PHP version to PHP 8.2 and then log out of this user, go into the admin user and change the PHP settings like I showed you. If the installation was interrupted, go into the file manager and delete everything inside of `public_html`. Once you have made the changes, you can then try to reinstall Nextcloud.

So that’s it for this video. Alright, so if you have any questions, let me know in the comments. I will try my best to reply in time. Sometimes I don’t see the comments, so just try and comment again. Don’t comment under somebody else’s comment, so just start your own thread of comment if you have a question. That’s it for this video. If you’re going to use any VPS for this, and of course, you’re going to use one, just please consider supporting me. It takes a lot of time creating the videos, editing them, and your support is paramount to my motivation. Thank you for watching the video. I will see you next time.

Comment Here

Join this free course:

How to host multiple WordPress
websites on a VPS

Close me!