ServerGigabit Network

Complete Guide: How to Install Nextcloud via Terminal?

You are here:
Estimated reading time: 1 min

How to Install Nextcloud?

How to Install Nextcloud?
  1. Log in to your VPS as root

ssh root@your_server_ip
  1. Update the server

apt update -y && apt upgrade -y
  1. Install required packages

apt install -y apache2 mariadb-server libapache2-mod-php \
php php-mysql php-xml php-zip php-curl php-gd php-mbstring php-intl php-bcmath unzip wget
  1. Secure MariaDB

mysql_secure_installation
  1. Create Nextcloud database

mysql -u root -p
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
  1. Download Nextcloud

cd /var/www
wget https://download.nextcloud.com/server/releases/latest.zip
unzip latest.zip
chown -R www-data:www-data nextcloud
chmod -R 755 nextcloud
  1. Configure Apache

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

Paste:

<VirtualHost *:80>
    DocumentRoot /var/www/nextcloud
    <Directory /var/www/nextcloud/>
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
    </Directory>
</VirtualHost>
  1. Enable site and modules

a2ensite nextcloud.conf
a2enmod rewrite headers env dir mime
systemctl restart apache2
  1. Access Nextcloud Web Installer

http://your_server_ip
  1. Complete setup in browser

- Create admin account
- Enter database name, user, password
- Finish installation
Was this article helpful?
Dislike 0
Views: 2