Create Your Own Cloud with NextCloud on Rocky Linux 8
This tutorial guides you through the process of setting up NextCloud, a self-hosted cloud storage and collaboration platform, on Rocky Linux 8. NextCloud allows you to store files, manage calendars and contacts, and collaborate with others securely.
rocky linuxNextCloud
Custom
VPS
4
vCPU
8 GB
Memory
80 GB
NVMe Disk
10240 GB
Traffic
20.90€
/month
* Up to 4 IPv4, 1Gbit/s Network Speed, 16 vCPU, 48GB RAM, 480GB NVMe Disk Space
#### Prerequisites
Before you begin, ensure you have:
- Access to a terminal on your Rocky Linux 8 system
- Administrative privileges (sudo or root access)
- A domain name or static IP address for your server
#### Step 1: Install LAMP Stack
Ensure your Rocky Linux 8 server has a LAMP (Linux, Apache, MySQL, PHP) stack installed. You can refer to the tutorial "Build a Powerful LAMP Stack on Rocky Linux 8" for detailed instructions.
#### Step 2: Install Required Dependencies
Install additional dependencies required by NextCloud:
```bash
sudo dnf install php php-mysqlnd php-json php-mbstring php-intl php-gd php-pecl-apcu php-pecl-imagick php-ldap php-pdo mariadb-server
```
#### Step 3: Create a MySQL/MariaDB Database for NextCloud
Log in to MySQL/MariaDB as the root user:
```bash
sudo mysql -u root -p
```
Create a new database and user for NextCloud:
```sql
CREATE DATABASE nextcloud;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
```
#### Step 4: Download and Install NextCloud
Download the latest stable release of NextCloud and move it to your web server directory:
```bash
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
sudo tar -xvf latest.tar.bz2 -C /var/www/html/
sudo chown -R apache:apache /var/www/html/nextcloud/
```
#### Step 5: Configure Apache for NextCloud
Create a new Apache configuration file for NextCloud:
```bash
sudo nano /etc/httpd/conf.d/nextcloud.conf
```
Add the following configuration (replace `your_domain_or_ip` with your server's domain name or IP address):
```apache
Alias /nextcloud "/var/www/html/nextcloud/"
Options +FollowSymlinks
AllowOverride All
Require all granted
DocumentRoot /var/www/html/nextcloud/
ServerName your_domain_or_ip
Options +FollowSymlinks
AllowOverride All
Require all granted
ErrorLog /var/log/httpd/nextcloud_error.log
CustomLog /var/log/httpd/nextcloud_access.log combined
```
Save and close the file. Restart Apache to apply the changes:
```bash
sudo systemctl restart httpd
```
#### Step 6: Complete the NextCloud Setup
Open a web browser and navigate to your server's domain name or IP address:
```
http://your_domain_or_ip/nextcloud
```
Follow the on-screen instructions to complete the NextCloud setup. Enter the database details created earlier and create an admin account.
#### Step 7: Configure SSL/TLS (Optional)
For secure access, configure SSL/TLS certificates using Let's Encrypt. You can refer to the tutorial "Secure Your Site: Install Let's Encrypt SSL with LAMP Stack on Rocky Linux 8" for instructions.
#### Conclusion
You have successfully set up NextCloud on Rocky Linux 8, allowing you to create your own cloud storage and collaboration platform. Start uploading files, managing calendars, and collaborating securely with NextCloud.
**Additional Resources:**
- **NextCloud Documentation:** [https://docs.nextcloud.com/](https://docs.nextcloud.com/)
- **Rocky Linux Documentation:** [https://docs.rockylinux.org/](https://docs.rockylinux.org/)