//------------------------------------------------------------------- //-------------------------------------------------------------------
Run Nextcloud on Storage VPS

Run Nextcloud on a High Storage VPS and Reduce Your Cloud Costs

Running Nextcloud on Storage VPS allows you to create a private and secure cloud for your team. By using a High Storage VPS, you achieve massive disk space directly attached to your server, which ensures fast access without the latency of external object storage.

In this guide, you will learn to install Nextcloud on a High Storage VPS using Ubuntu 24.04 LTS, Apache, MariaDB, and PHP 8.3, which is the current standard for stability and performance.

Prerequisites for Setting up Nextcloud on Storage VPS

Before you start, make sure to have a VPS running Ubuntu 24.04 LTS with at least 2GB RAM and a large disk partition. 4GB is recommended for production use.

You need a valid Domain name that is pointed to your VPS IP address, for example, cloud.yourdomain.com.

Also, make sure to have root access or sudo privileges to execute the commands.

Note: For this tutorial, you’ll need a High Storage VPS. If you don’t have one yet, check out PerLod Hosting for affordable storage-optimized plans.

Prepare your System for Nextcloud Setup

You must run the system update and upgrade to ensure all existing packages are secure:

sudo apt update && sudo apt upgrade -y

Also, you can verify your High Storage partition is mounted and ready. Usually, it is your root partition / or mounted at /mnt. To check this, you can run the command below:

df -h

If you see a large partition mounted at /, for example, 500GB+, it is OK. If it is mounted elsewhere, like /mnt/storage, note that path for next steps.

Install LAMP Stack and Dependencies for Nextcloud Setup

Nextcloud requires a web server, database, and PHP. Ubuntu 24.04 ships with PHP 8.3, which is fully supported. You can use the commands below to install the LAMP stack and dependencies:

sudo apt install apache2 mariadb-server redis-server \
libapache2-mod-php php8.3-gd php8.3-mysql php8.3-curl \
php8.3-mbstring php8.3-intl php8.3-gmp php8.3-bcmath \
php8.3-xml php8.3-imagick php8.3-zip php8.3-bz2 \
php8.3-opcache php8.3-apcu php8.3-redis unzip -y

The php8.3-redis and redis-server are essential for high-storage setups to prevent database locking when multiple users upload files simultaneously.

Nextcloud Database Configuration

In this step, you must secure your database installation and create a dedicated user for Nextcloud.

Run the security script for your database with the command below:

sudo mysql_secure_installation

Answer Y to switch to unix_socket authentication, change root password, remove anonymous users, disallow root login remotely, and remove test database.

Log in to your MariaDB shell with the command below:

sudo mysql -u root -p

Run the following SQL commands to create the Nextcloud user and grant the required privileges for it:

CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Download Nextcloud and Set up the Data Directory

At this point, you can download the latest release of Nextcloud by using the commands below:

cd /var/www/
sudo wget https://download.nextcloud.com/server/releases/latest.zip
sudo unzip latest.zip
sudo rm latest.zip

For better security, you can keep the data folder outside the public web directory. Instead of keeping data inside /var/www/nextcloud/data, you can create a dedicated directory.

Note: If your large storage is mounted at /mnt/storage, use /mnt/storage/nc_data instead.

To create a secure data directory, use the command below:

sudo mkdir -p /var/www/nextcloud_data

Apache needs full control over these directories. To set the correct ownership, run the following commands:

sudo chown -R www-data:www-data /var/www/nextcloud
sudo chown -R www-data:www-data /var/www/nextcloud_data

Configure Apache Virtual Host to Serve Nextcloud

Now we need to tell Apache how to serve Nextcloud. You can create a Virtual Host file to link your domain to the Nextcloud directory.

Create the config file with your desired text editor:

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

Add the following content to the file with your actual domain:

<VirtualHost *:80>
    ServerName cloud.yourdomain.com
    DocumentRoot /var/www/nextcloud

    <Directory /var/www/nextcloud/>
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Once you are done, enable the site and modules with the commands below:

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

Secure Nextcloud with SSL Certbot

At this point, you can secure your Nextcloud with an SSL certificate. Use Certbot to obtain a free Let’s Encrypt certificate, ensuring all your files are transferred securely over HTTPS.

Install Certbot and obtain your SSL certificate for your domain with the commands below:

sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d cloud.yourdomain.com

Follow the prompts and choose Redirect to force HTTPS.

Access Nextcloud Web Wizard and Finish Installation

To finish the installation and access the Nextcloud dashboard, open your browser and go to:

https://cloud.yourdomain.com

Create an Admin account by entering a username and a strong password.

Change the default path to /var/www/nextcloud_data or your custom storage path.

Configure your database credentials as you configured:

  • User: nextclouduser
  • Password: secure_password
  • Database: nextcloud
  • Host: localhost

Finally, click Install to complete the Nextcloud setup.

Nextcloud Performance Tuning on Storage VPS

After your Nexcloud setup is completed, you can optimize PHP and Redis to ensure the VPS runs smoothly under load.

First, you must configure the PHP limits. Edit the PHP initialization file with the command below:

sudo nano /etc/php/8.3/apache2/php.ini

Modify these values to allow large file uploads, for example, 1GB:

memory_limit = 512M
upload_max_filesize = 1G
post_max_size = 1G
max_execution_time = 300
date.timezone = UTC

Then, you must enable Redis caching. To do this, edit the Nextcloud config file:

sudo nano /var/www/nextcloud/config/config.php

Add the following lines before the closing “);” bracket:

'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
  'host' => 'localhost',
  'port' => 6379,
),
'default_phone_region' => 'US', 

Remember to replace US with your country code.

Once you are done, you must enable system Cron, because Nextcloud runs background jobs, and using the system cron is more reliable than AJAX.

sudo crontab -u www-data -e

Add this line to the bottom:

*/5 * * * * php -f /var/www/nextcloud/cron.php

To apply the changes, restart Apache:

sudo systemctl restart apache2

At this point, your installation and optimization are completed. You can go to your Administration Settings and Overview in your Nextcloud dashboard. It should pass all security checks.

Now you have a fully functional and self-hosted cloud on your storage VPS.

FAQs

Is it safe to store sensitive team files on a self-hosted Nextcloud?

Yes, as long as you keep the server updated, enforce strong passwords, enable two-factor authentication, and always use HTTPS.

What happens to Nextcloud if the disk gets full?

Nextcloud will stop accepting uploads when the disk is full. Monitor usage from Administration Settings and System, and set up storage quotas per user to prevent this.

Can I connect Nextcloud to a desktop or mobile app?

Yes. Nextcloud has official clients for Windows, macOS, Linux, Android, and iOS. Just enter your server URL and credentials to sync files across devices.

Conclusion

Self-hosting Nextcloud on a High Storage VPS puts you in full control of your team’s data, no monthly subscription, no storage limits set by someone else. With everything configured in this guide, your setup is secure, fast, and ready for real use.

We hope you enjoy using this guide. Subscribe to our X and Facebook to get the latest updates and articles on storage VPS hosting.

For further reading:

Proxy API Requests Without Changing Code

Install Samba File Sharing Server on Linux VPS

Which Control Panel is Best for Linux VPS?

Post Your Comment

PerLod delivers high-performance hosting with real-time support and unmatched reliability.

Contact us

Payment methods

payment gateway
Perlod Logo
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.