Nextcloud is a widely used open source cloud storage software that allows users to store, share, and collaborate on their files, calendars, contacts, and more. In this tutorial, we will guide you through the step-by-step process of installing Nextcloud on your EndeavourOS system.
Before installing any new package, it is usually recommended to update our system's package list and upgrade the installed packages to their latest version using the following command.
sudo pacman -Syu
In order to install Nextcloud on your EndeavourOS system, we need to first install some required dependencies. These include PHP and its extensions, the web server, and the database server.
By default, EndeavourOS comes with PHP 7.4. To install the required PHP extensions, run the following command.
sudo pacman -S php php-gd php-intl php-mbstring php-apcu php-zip
If you prefer using Nginx as your web server, install it using the following command.
sudo pacman -S nginx
If you prefer using the Apache web server, install it using the following command.
sudo pacman -S apache
Nextcloud requires either MariaDB or MySQL as a database server. To install MariaDB, run the following command.
sudo pacman -S mariadb
After installation, we need to configure MariaDB by setting up a root password, removing anonymous users, disabling remote root login, and removing the test database.
First, start the MariaDB service and enable it to start at boot time using the following command.
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Next, run the following command to secure MariaDB:
sudo mysql_secure_installation
During the process, you will be prompted to set a root password, remove anonymous users, disable remote root login, and remove the test database.
Log in to the MariaDB server using the root user and the password you set in the previous step.
sudo mysql -u root -p
Once logged in, create a new database and a user and grant them permissions to the database. Replace nextcloud_db
, nextcloud_user
, and password
with your preferred database name, database user, and password.
CREATE DATABASE nextcloud_db;
GRANT ALL ON nextcloud_db.* TO 'nextcloud_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
Next, we need to download and install Nextcloud. The latest version of Nextcloud can be found on their official website.
cd /var/www
sudo wget https://download.nextcloud.com/server/releases/latest.tar.bz2
sudo tar -jxf latest.tar.bz2
sudo chown -R http:http nextcloud
sudo rm latest.tar.bz2
Next, we need to configure the web server.
If you are using Nginx as your web server, create a new server block with the following contents.
server {
listen 80;
server_name your_domain.com; # Replace with your domain name
root /var/www/nextcloud/;
index index.php;
location / {
try_files $uri $uri/ /index.php$request_uri;
}
location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
deny all;
}
location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; # Change to your PHP-FPM socket
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Save the changes and restart the Nginx service.
sudo systemctl restart nginx.service
If you are using Apache as your web server, create a new virtual host with the following contents.
<VirtualHost *:80>
ServerName your_domain.com # Replace with your domain name
DocumentRoot /var/www/nextcloud/
<Directory /var/www/nextcloud/>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
ErrorLog /var/log/httpd/your_domain.com-error.log
CustomLog /var/log/httpd/your_domain.com-access.log combined
<IfModule mod_php.c>
php_admin_flag engine on
</IfModule>
</VirtualHost>
Save the changes and restart the Apache service.
sudo systemctl restart httpd.service
Finally, open your web browser and navigate to your domain name or IP address. Follow the on-screen instructions to complete the installation of Nextcloud. During the process, you will be asked to provide the database details we created in Step 4.
Congratulations! You have successfully installed Nextcloud on your EndeavourOS system.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!