Nextcloud Installation on Hostcarts VPS
Here’s the correct, production‑grade method to install Nextcloud on a Hostcarts VPS, based on the official Nextcloud installation documentation and standard Ubuntu server setup practices.
This guide is optimized for your Hostcarts environment and follows the same structure you use for your infrastructure deployments.
Nextcloud Installation on Hostcarts VPS (Ubuntu 22.04 / 24.04)
This method uses Apache + MariaDB + PHP, which is the officially recommended stack.
Sources: Nextcloud
Prerequisites
- Hostcarts VPS (Ubuntu 22.04 or 24.04)
- Root or sudo access
- Domain (optional but recommended)
- Basic Linux familiarity (you already have this)
Step‑by‑Step Installation
Below is a structured, technical installation guide using the Step-by-Step Troubleshooting/Setup Template.
Sources: Nextcloud
- Update Your Server
sudo apt update && sudo apt upgrade -y
- Install Apache, MariaDB & PHP (Required Modules)
Official docs recommend installing all required PHP extensions.
sudo apt install apache2 mariadb-server libapache2-mod-php \
php-gd php-mysql php-curl php-mbstring php-intl php-gmp \
php-xml php-imagick php-zip php-bz2 php-fpm php-cli -y
Enable Apache modules:
sudo a2enmod rewrite headers env dir mime ssl
sudo systemctl restart apache2
- Create the Nextcloud Database
Enter MariaDB:
sudo mysql
Run:
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'StrongPassword';
CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
QUIT;
(These steps match official documentation.) Nextcloud
- Download Nextcloud
Get the latest version:
cd /tmp
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -xjf latest.tar.bz2
Move it to the web directory:
sudo mv nextcloud /var/www/
sudo chown -R www-data:www-data /var/www/nextcloud
sudo chmod -R 755 /var/www/nextcloud
- Create Apache Virtual Host
sudo nano /etc/apache2/sites-available/nextcloud.conf
Paste:
ServerName cloud.example.com
DocumentRoot /var/www/nextcloud/
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
Enable site:
sudo a2ensite nextcloud.conf
sudo systemctl reload apache2
- Enable HTTPS (Let’s Encrypt SSL)
sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d cloud.example.com
- Configure Cron (Recommended by Nextcloud)
sudo -u www-data crontab -e
Add:
*/5 * * * * php -f /var/www/nextcloud/cron.php
- (Optional but Recommended) Enable Redis Caching
Redis improves performance significantly.
This is recommended in modern Nextcloud guides. YouStable
Install Redis:
sudo apt install redis-server php-redis -y
sudo systemctl enable redis-server --now
Edit config:
sudo nano /var/www/nextcloud/config/config.php
Add:
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' => [
'host' => 'localhost',
'port' => 6379,
],
- Complete Web Installer
Open browser:
http://cloud.example.com
Enter:
- Admin username & password
- Database: nextcloud
- DB user: nextcloud
- DB password
- Host: localhost
Nextcloud will auto‑create tables. Nextcloud
Your Nextcloud is now fully installed on Hostcarts VPS
Comments0
No Comments Yet
Be the first to share your thoughts.
Please sign in or sign up to leave a comment.