Create an account

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Build your own cloud with Fedora 31 and Nextcloud Server

Build your own cloud with Fedora 31 and Nextcloud Server

Nextcloud is a software suite for storing and syncing your data across multiple devices. You can learn more about Nextcloud Server’s features from

This article demonstrates how to build a personal cloud using Fedora and Nextcloud in a few simple steps. For this tutorial you will need a dedicated computer or a virtual machine running Fedora 31 server edition and an internet connection.

Step 1: Configure the server

Start by updating your system and rebooting:

$ sudo -i
# dnf upgrade
# reboot

Next, disable SELinux by changing enforcing to disabled in /etc/selinux/config and then rebooting to activate the new setting:

# vi /etc/selinux/config
# reboot

If you don’t want to reboot right away, you can use the setenforce command to disable SELinux in the current session.

# setenforce 0

Alternatively, you can follow the directions here to configure SELinux to work with Nextcloud.

Step 2: Install the prerequisites

Before installing and configuring Nextcloud, a few prerequisites must be satisfied.

First, install Apache web server:

# dnf install httpd

Next, install PHP and some additional modules. Make sure that the PHP version being installed meets Nextcloud’s requirements:

# dnf install php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-pecl-redis php-opcache php-imagick php-zip php-process

After PHP is installed enable and start the Apache web server:

# systemctl enable --now httpd

Next, allow HTTP traffic through the firewall:

# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload

Next, install the MariaDB server and client:

# dnf install mariadb mariadb-server

Then enable and start the MariaDB server:

# systemctl enable --now mariadb

Now that MariaDB is running on your server, you can run the mysql_secure_installation command to secure it:

# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the
current password for the root user. If you've just installed
MariaDB, and you haven't set the root password yet, the password
will be blank, so you should just press enter here. Enter current password for root (enter for none): <ENTER>
OK, successfully used password, moving on... Setting the root password ensures that nobody can log into
the MariaDB root user without the proper authorization. Set root password? [Y/n] <ENTER>
New password: Your_Password_Here
Re-enter new password: Your_Password_Here Password updated successfully! Reloading privilege tables... ... Success! By default, a MariaDB installation has an anonymous user,
allowing anyone to log into MariaDB without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother. You
should remove them before moving into a production environment. Remove anonymous users? [Y/n] <ENTER> ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the
root password from the network. Disallow root login remotely? [Y/n] <ENTER> ... Success! By default, MariaDB comes with a database named 'test' that
anyone can access. This is also intended only for testing, and
should be removed before moving into a production environment. Remove test database and access to it? [Y/n] <ENTER> - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes
made so far will take effect immediately. Reload privilege tables now? [Y/n] <ENTER> ... Success! Cleaning up... All done! If you've completed all of the above steps, your
MariaDB installation should now be secure. Thanks for using MariaDB!

Step 3: Install Nextcloud Server

Now that the prerequisites for your Nextcloud installation have been satisfied, download and unzip the Nextcloud archive:

# wget
# unzip -d /var/www/html/

Next, create a data folder and grant Apache read and write access to the nextcloud directory tree:

# mkdir /var/www/html/nextcloud/data
# chown -R apache:apache /var/www/html/nextcloud

Next, create a dedicated user and database for your Nextcloud instance:

# mysql -p
> create database nextcloud;
> create user 'nc_admin'@'localhost' identified by 'SeCrEt';
> grant all privileges on nextcloud.* to 'nc_admin'@'localhost';
> flush privileges;
> exit;

Step 4: Configure Nextcloud

Nextcloud can be configured using its web interface or from the command line.

Using the web interface

From your favorite browser, access http://your_server_ip/nextcloud and fill the fields:

Using the command line

From the command line, just enter the following, substituting the values you used when you created a dedicated Nextcloud user in MariaDB earlier:

# sudo -u apache php occ maintenance:install --data-dir /var/www/html/nextcloud/data/ --database "mysql" --database-name "nextcloud" --database-user "nc_admin" --database-pass "DB_SeCuRe_PaSsWoRd" --admin-user "admin" --admin-pass "Admin_SeCuRe_PaSsWoRd"

Final Notes

  • I used the http protocol, but Nextcloud also works over https. I might write a follow-up about securing Nextcloud in a future article.
  • I disabled SELinux, but your server will be more secure if you configure it.
  • The recommend PHP memory limit for Nextcloud is 512M. To change it, edit the memory_limit variable in the /etc/php.ini configuration file and restart your httpd service.
  • By default, the web interface can only be accessed using the http://localhost/ URL. If you want to allow access using other domain names, you can do so by editing the /var/www/html/nextcloud/config/config.php file. The * character can be used to bypass the domain name restriction and allow the use of any URL that resolves to one of your server’s IP addresses.
'trusted_domains' => array ( 0 => 'localhost', 1 => '*', ),

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Now available: Fedora on Lenovo laptops! xSicKxBot 0 1 9 hours ago
Last Post: xSicKxBot
  Fedora - Installing and running Vagrant using qemu-kvm xSicKxBot 0 15 09-21-2020, 06:22 PM
Last Post: xSicKxBot
  Fedora - Incremental backups with Btrfs snapshots xSicKxBot 0 7 09-15-2020, 01:20 PM
Last Post: xSicKxBot
  Fedora - Ankur Sinha: How do you Fedora? xSicKxBot 0 17 09-11-2020, 02:22 PM
Last Post: xSicKxBot
  Fedora - Tune up your sound with PulseEffects: Microphones xSicKxBot 0 40 08-31-2020, 11:09 AM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Test Week for Btrfs xSicKxBot 0 42 08-26-2020, 01:20 PM
Last Post: xSicKxBot
  Fedora - Btrfs Coming to Fedora 33 xSicKxBot 0 46 08-24-2020, 01:28 PM
Last Post: xSicKxBot
  Fedora - Configure Fedora to practice and compose music xSicKxBot 0 38 08-22-2020, 12:44 PM
Last Post: xSicKxBot
  Fedora - Tune up your sound with PulseEffects: Speakers xSicKxBot 0 40 08-19-2020, 04:08 PM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Kernel and GNOME test days xSicKxBot 0 46 08-18-2020, 02:42 PM
Last Post: xSicKxBot

Forum Jump:

Become a Patron!
Upcoming Events

Latest Threads
Nike Air Force 1 React Zwart/Habanero Re...
Last Post: 4v0f0cll
Today 03:26 AM
» Replies: 0
» Views: 2
Nike Air Force 1 React Blancas/Astronomy...
Last Post: 4v0f0cll
Today 03:24 AM
» Replies: 0
» Views: 2
Microsoft - CVP Sam George: How Azure Io...
Last Post: xSicKxBot
Today 02:57 AM
» Replies: 0
» Views: 1
[1.06] BO4 Zombie Trainer (Call of duty ...
Last Post: travitan3
Today 01:54 AM
» Replies: 3
» Views: 165
[Tut] How To Format A String That Contai...
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 1
(Indie Deal) METAL GEAR RISING at 80% OF...
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 2
(Free Game Key) Scrap Garden is Free on ...
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 2
Unreal Engine 4.26 Preview 1 Released
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 2
AppleInsider - How to buy Apple Watch fa...
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 1
Microsoft - Get paid for your photos wit...
Last Post: xSicKxBot
Yesterday 07:51 PM
» Replies: 0
» Views: 1


Get the Deal of the Week at

Copyright © 2012-2020