Setting up Nextcloud on Raspberry pi

Installing Nextcloud on Raspeberry pi

Setting up Nextcloud on a Raspberry Pi is a relatively straightforward process. Here’s a general outline of the steps:

  1. Install Raspbian OS: You will need to install Raspbian, which is a Linux distribution designed for the Raspberry Pi. Follow the instructions to download and install the latest version of Raspbian on your Raspberry Pi.

2.Update the system: Once Raspbian is installed, run the following command to update the system:

sudo apt-get update && sudo apt-get upgrade

3.Install Apache and PHP: Next, install the Apache web server and PHP by running the following command:

sudo apt-get install apache2 php php-gd php-mysql libapache2-mod-php

4.Install MariaDB: Next, install MariaDB, which is a popular database server, by running the following command:

sudo apt-get install mariadb-server

5.Create a database: Once MariaDB is installed, you will need to create a database for Nextcloud. Run the following command and enter your preferred database name, username, and password when prompted:

sudo mysql -u root
CREATE DATABASE nextcloud;
GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

6.Install Nextcloud: Download the latest version of Nextcloud by running the following command:

wget https://download.nextcloud.com/server/releases/latest.tar.bz2

Extract the downloaded file by running:

tar -xvf latest.tar.bz2

Move the extracted folder to the web root directory by running:

sudo mv nextcloud /var/www/html/

7.Set permissions: Set the correct permissions for the Nextcloud directory by running:

sudo chown -R www-data:www-data /var/www/html/nextcloud/
sudo chmod -R 755 /var/www/html/nextcloud/

8.Configure Apache: Create a new Apache virtual host configuration file for Nextcloud by running:

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

Paste the following configuration into the file:

<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/nextcloud/
ServerName example.com
ServerAlias www.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/nextcloud
SetEnv HTTP_HOME /var/www/html/nextcloud
</Directory>
</VirtualHost>

Replace “example.com” with your domain name or IP address. Save and close the file.

9.Enable the virtual host: Enable the new virtual host by running:

sudo a2ensite nextcloud.conf

Restart Apache by running:

sudo systemctl restart apache2

10.Complete the setup: Finally, visit your domain name or IP address in a web browser and follow the setup wizard to complete the installation of Nextcloud. Enter the database name, username, and password that you created earlier, and set up an administrator account.

That’s it! You should now have a working Nextcloud installation on your Raspberry

Comments

Popular Posts