How To Install Nextcloud on Fedora 39
In this tutorial, we will show you how to install Nextcloud on Fedora 39. Nextcloud, a powerful open-source cloud storage platform, offers a secure and private alternative to popular cloud services. With Nextcloud, you can control, manage, and access your files from anywhere, anytime.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Nextcloud file hosting on a Fedora 39.
Prerequisites
Before diving into the installation process, let’s ensure that you have everything you need:
- A server running one of the following operating systems: Fedora 39.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. Fedora 39 provides the Terminal application for this purpose. It can be found in your Applications menu.
- You’ll need an active internet connection to download Nextcloud and its dependencies.
- You will also need a domain name pointed at your server‘s public IP address.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Nextcloud on Fedora 39
Step 1. Before we begin the installation process, it’s crucial to ensure that your Fedora system is up-to-date. Open your terminal and run the following command to update all installed packages:
sudo dnf update
Step 2. Installing LAMP Stack.
Before we dive into this tutorial, it’s crucial to ensure that your server is equipped with the powerful LAMP stack. If you haven’t already set up LAMP, don’t worry – we’ve got you covered. Just follow our comprehensive guide available right here.
Step 3. Installing Nextcloud on Fedora 39.
Now that the LAMP stack is installed, we can proceed with installing Nextcloud. First, download the latest version of Nextcloud from their official website using the wget
command:
wget https://download.nextcloud.com/server/releases/latest.zip
Extract the downloaded file and move it to the Apache web root directory:
unzip latest.zip sudo mv nextcloud /var/www/html/
Next, create a data directory for Nextcloud and change its ownership to the Apache user:
sudo mkdir -p /var/www/html/nextcloud/data sudo chown -R apache:apache /var/www/html/nextcloud
Step 4. Creating a Database.
Log in to the MariaDB server using the MariaDB client command below. Input the MariaDB root password when prompted:
sudo mariadb -u root -p
Once logged in to MariaDB, run the following queries to create a new MariaDB database and user for Nextcloud:
CREATE DATABASE nextcloud_db; CREATE USER nextclouduser@localhost IDENTIFIED BY 'Your-Strong-Password'; GRANT ALL PRIVILEGES ON nextcloud_db.* TO nextclouduser@localhost; FLUSH PRIVILEGES; EXIT;
Step 5. Configuring Apache for Nextcloud.
To make Nextcloud accessible via a web browser, we need to create and configure a new Apache configuration file for Nextcloud. Use a text editor to create a new configuration file:
sudo nano /etc/httpd/conf.d/nextcloud.conf
In the opened file, add the following configuration:
Alias /nextcloud "/var/www/html/nextcloud/" <Directory /var/www/html/nextcloud/> Require all granted AllowOverride All Options FollowSymLinks MultiViews <IfModule mod_dav.c> Dav off </IfModule> </Directory>
Save and close the file. Then, restart the Apache service to apply the changes:
sudo systemctl restart httpd
Step 6. Secure Nextcloud with Let’s Encrypt SSL using Certbot.
Install Certbot and the Apache plugin:
sudo dnf install certbot python3-certbot-apache
Obtain and install an SSL certificate:
sudo certbot --apache -d your_domain.com
Follow the prompts to complete the process. Certbot will automatically configure SSL for your Nextcloud domain and set up automatic certificate renewal.
Step 7. Configure Firewall.
FirewallD is the default firewall management tool for Fedora. If it’s not already installed on your server, you can install it using the following command:
sudo dnf install firewalld
Once FirewallD is installed, start the service and enable it to start at boot using the following commands:
sudo systemctl start firewalld sudo systemctl enable firewalld
Nextcloud operates over HTTP and HTTPS, which use ports 80 and 443 respectively. You need to open these ports in your firewall to allow traffic to and from your Nextcloud server. Use the following commands to permanently open these ports:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https
Then, reload the firewall to apply the changes:
sudo firewall-cmd --reload
Step 8. Accessing and Setting Up Nextcloud Interface.
You can now access Nextcloud via a web browser by navigating to https://your_domain.com/nextcloud
. The setup wizard will guide you through the rest of the setup process. You’ll need to create an admin account, specify the data folder location (which we created earlier), and provide the database information.
Congratulations! You have successfully installed Nextcloud. Thanks for using this tutorial for installing the Nextcloud open-source file hosting on your Fedora 39 system. For additional or useful information, we recommend you check the official Nextcloud website.