Nextcloud is a free and open-source syncing and file sharing server. It is self-hosted and allows companies to have a central point of storing information for easy collaboration. With nextcloud, users can share documents, videos and pictures in a centralized location. They can make changes to the documents and through automated syncing, the other users will see the updated information. Nextcloud provides client tools for Windows, Linux, MacOS and even mobile devices that can be used to interact with Nextcloud server. In this article, we are going to look at how to install and configure Nextcloud on Oracle Linux 9 | AlmaLinux 9.
Features Of Nextcloud
Nextcloud is a powerful sharing and collaboration tool and is characterized by the following features:
- Nextcloud files – Sharing and collaboration, powerful search, access from desktop and mobile clients, automatic sync, permissions, comments and ability to lock a file while working on it.
- Video and audio conferencing
- Productivity features such as calendar, contacts ans mail
What is New in Nextcloud 30?
With Nextcloud 30, there are notable added features as summarized below:
File Management Enhancements
- Folder Upload Support: Upload entire folders directly through the web interface for streamlined file management.
- File List Filters: Implemented filters in the file list allow quick navigation based on criteria like file type.
- New File Request Option: Create file requests directly from the sharing interface to simplify requesting files from others.
- Display Original Location and Deleter in Trash Bin: The trash bin now shows the original location of deleted files and who deleted them, aiding in file recovery and accountability.
Sharing and Collaboration Improvements
- Improved Share Email Format: Enhanced email templates offer a better experience when sharing files via email.
- Share Link Upload Notifications: Activity notifications have been added for uploads via share links, keeping you informed about file changes.
- Support for Excalidraw Files: Added support for
.excalidraw
files to facilitate collaboration on diagrams and sketches. - Activity App Enhancements:
- Grouped Email Notifications: Activities sent by email are now grouped, reducing email clutter and making notifications more organized.
User Management and Security
- Admin Delegation for Users and Groups: Administrators can delegate user and group management tasks to improve workflow efficiency.
- Restrict Admin Actions to IP Ranges: Enhance security by restricting admin actions to specific IP ranges.
- Out-of-Office Replacement: Users can select another user as their out-of-office replacement, ensuring workflow continuity.
- Password Hash Management: Get and set the password hash of a user, aiding in user management and migration scenarios.
- Sort Users by Last Login: Administrators can sort user lists by last login time to manage inactive accounts effectively.
- Enhanced Suspicious Login Notifications: Email notifications for suspicious logins now include a “More Info” button and improved text, helping users quickly assess potential security issues.
The following steps will guide us through the process of installing Nextcloud on Oracle Linux 9 | AlmaLinux 9.
Step 1: Install LAMP – Apache, MariaDB and PHP
Nextcloud is accessible via the browser and it also requires a database to store its content. As such, we will simply install LAMP server since we are also working on a Linux.
Install Apache web server
We are going to be using Apache web server. You can install Apache on Oracle Linux 9 | AlmaLinux 9 with the below command:
sudo dnf -y install httpd
sudo systemctl enable httpd
sudo systemctl start httpd
We need to open port 80 on the firewall for Apache application
sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload
Check that you can open the default Apache web page to confirm a successful installation. On your browser, type http://<your-server-ip>. You should get the page as shown:
Install PHP on Oracle Linux 9 | AlmaLinux 9
For this installation, we are going to be using php 8. Install php 8 on Oracle Linux 9 | AlmaLinux 9 with the below steps. First, install EPEL and Remi repositories.
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
You can list available php modules to make sure you have php8.
$ sudo dnf module list php
Remi's Modular repository for Enterprise Linux 9 - x86_64 383 kB/s | 772 kB 00:02
Safe Remi's RPM repository for Enterprise Linux 9 - x86_64 560 kB/s | 1.2 MB 00:02
Last metadata expiration check: 0:00:01 ago on Wed 22 Jan 2025 03:35:46 PM EAT.
Oracle Linux 9 Application Stream Packages (x86_64)
Name Stream Profiles Summary
php 8.1 common [d], devel, minimal PHP scripting language
php 8.2 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream Profiles Summary
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
php remi-8.2 common [d], devel, minimal PHP scripting language
php remi-8.3 common [d], devel, minimal PHP scripting language
php remi-8.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
You can see that we have php 8.0, 8.1, 8.2, 8.3, and 8.4. Let’s proceed to install/enable version 8.4.
sudo dnf module enable php:remi-8.3 -y
Install the required php modules as below:
sudo dnf install -y php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring php-common php-json php-zip
Start and enable php-fpm and restart httpd
sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service
sudo systemctl restart httpd
Install MariaDB database server
We are going to be installing MariaDB database to be used by Nextcloud.
sudo dnf install -y mariadb mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
Secure MariaDB and set root password
$ sudo mysql_secure_installation
---
Enter current password for root (enter for none): Just press Enter
Set root password? [Y/n] Y
New password: New-root-password
Re-enter new password: Re-enter New-root-password
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Thanks for using MariaDB!
Create a database for Nextcloud. Access mysql with the below command:
mysql -u root -p
Provide the password set above and continue to create a database and a user
CREATE DATABASE nextcloudDB;
CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'StrongDBPassw0rd';
GRANT ALL PRIVILEGES On nextcloudDB.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'StrongDBPassw0rd';
FLUSH PRIVILEGES;
EXIT;
Step 2: Install Nextcloud on Oracle Linux 9 | AlmaLinux 9
Download Nextcloud server with the below command:
sudo wget https://download.nextcloud.com/server/releases/latest.zip
Once downloaded, extract it as shown
sudo dnf -y install unzip
unzip latest.zip
Next, move the extracted files to the document root of Apache (/var/www/html). Also create a data directory to store user data.
sudo mv nextcloud /var/www/html
sudo mkdir /var/www/html/nextcloud/data
Make Apache user the owner of the above files
sudo chown -R apache:apache /var/www/html/nextcloud/
Step 3: Configure SELinux permissions
We need to configure SEliux context to allow Nextcloud to write data in the required directories. Run the following commands:
sudo dnf install -y policycoreutils-python-utils
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.htaccess'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'
sudo restorecon -Rv '/var/www/html/nextcloud/'
Step 4: Set Up Nextcloud on Oracle Linux 9 | AlmaLinux 9
At this point, you can now access Nextcloud from the browser with http://<your-server-ip>/nextcloud.
Create an admin account:
Click on the dropdown to select your database and connect to it with previously created Database, user and password.
Scroll down and click ‘Install‘.
Once done, you will automatically be logged in with the created admin credentials. You should a page as below:
Step 5: Using Nextcloud on Oracle Linux 9 | AlmaLinux 9
You can now start uploading files directly to Nextcloud server as admin or as a user with admin rights and sharing them with your team members. To upload a file from your local storage, click on the files icon, then the plus sign and select ‘upload file‘.
When you have uploaded a file, you cash share it with others and set permissions on what those shared with can do on the files, such as read, write and share. To share a file, click the sharing icon, and you should be able to see the different sharing options:
Step 6: Install Nextcloud client
A nextcloud client will be installed on our local machines to enable us interact with the Nextcloud server. There are options available for Windows, MacOS and Linux. In our case, we will be installing Nextcloud client for Linux. Before we do that, ensure to have created a user on the Nextcloud server who will be using the client to connect to the server.
To create a user on Nextcloud server, click on Admin logo then Accounts. At this point, only admin user is currently created.
Click on New Account. You can see that you can add a user to admins group or to everyone’s group or you can create a specific group and put a user in there. You also need to assign the user a quota for their data.
Once you have created the user, you can now install Nextcloud client. Head to Nextcloud website and download a client depending on your operating system. For my case, I have downloaded for MacOS.
Run the application after a successfull installation.
Select ‘Log in‘. Enter Nextcloud server url (http://<nextcloud-server-ip>/nextcloud).
Nextcloud will automatically open the browser and ask you to login before the user is granted access to the Nextcloud server. Go ahead and log in. Click ‘Grant access‘ and the account will be connected.
Go back to the install wizard and click ‘Connect‘. Nextcloud will start synchronizing automatically.
You should also notice a Nextcloud folder added to your filesystem. Anything you put in this folder will automatically be synced to the cloud storage and if uploaded directly to the cloud server, the files will be synced back to this folder. All files shared with you will also be synced to the folder.
You have successfully installed Nextcloud server, configured it, uploaded files and share with others. We have also seen how we can install a client that can be used to automatically sync local files to the cloud storage. I hope the guide has been useful.
Here are related guides that can be of interest to you: