Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property ACF::$fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields.php on line 138

Deprecated: Creation of dynamic property acf_loop::$loops is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 28

Deprecated: Creation of dynamic property ACF::$loop is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 269

Deprecated: Creation of dynamic property ACF::$revisions is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/revisions.php on line 397

Deprecated: Creation of dynamic property acf_validation::$errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 28

Deprecated: Creation of dynamic property ACF::$validation is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 214

Deprecated: Creation of dynamic property acf_form_customizer::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 28

Deprecated: Creation of dynamic property acf_form_customizer::$preview_fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 29

Deprecated: Creation of dynamic property acf_form_customizer::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 30

Deprecated: Creation of dynamic property ACF::$form_front is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-front.php on line 598

Deprecated: Creation of dynamic property acf_form_widget::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 34

Deprecated: Creation of dynamic property acf_form_widget::$preview_reference is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 35

Deprecated: Creation of dynamic property acf_form_widget::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 36

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp_plugin/wp_plugin.php on line 23

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1539

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 828

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property acf_field_oembed::$width is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 31

Deprecated: Creation of dynamic property acf_field_oembed::$height is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 32

Deprecated: Creation of dynamic property acf_field_google_map::$default_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-google-map.php on line 33

Deprecated: Creation of dynamic property acf_field__group::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php on line 31

Deprecated: Creation of dynamic property acf_field_clone::$cloning is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 34

Deprecated: Creation of dynamic property acf_field_clone::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 35

Deprecated: Creation of dynamic property jh_acf_field_table::$settings is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-table-field/class-jh-acf-field-table.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":24899,"date":"2020-07-31T10:25:46","date_gmt":"2020-07-31T07:25:46","guid":{"rendered":"https:\/\/upcloud.com\/community\/tutorials\/install-nextcloud-centos"},"modified":"2020-07-31T10:25:46","modified_gmt":"2020-07-31T07:25:46","slug":"install-nextcloud-centos","status":"publish","type":"tutorial","link":"https:\/\/studiogo.tech\/upcloudold\/tutorial\/install-nextcloud-centos\/","title":{"rendered":"How to install Nextcloud on CentOS 8"},"content":{"rendered":"\n

Nextcloud is an open-source file sync and sharing software that can be used as a replacement for Google Drive, Yandex Disk and similar cloud-based storage. Nextcloud now has Onlyoffice to allow shared document editing and Nextcloud Talk, to enable video conferencing, so is a virtual office productivity solution.<\/p>\n\n\n\n

In this tutorial, we will set up Nextcloud 18 on a single cloud server using nginx as the web server and PostgreSQL as the database engine.<\/p>\n\n\n\n

\n
Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n

Setting up a new cloud server<\/h2>\n\n\n\n

Login to UpCloud and deploy a new server. In this case, we are using a Simple plan server with 1GB Memory, 25 GB storage with the CentOS 8 template. Once your server is deployed login by using SSH.<\/p>\n\n\n\n

ssh root@<your-ip-address><\/span><\/pre>\n\n\n\n

Once logged in change the password, then enter the new password twice.<\/p>\n\n\n\n

passwd<\/pre>\n\n\n\n

To secure the server, it is good to prevent login as the root user, thus another user needs to be created.<\/p>\n\n\n\n

Create a new username for yourself.<\/p>\n\n\n\n

adduser nextcloud<\/pre>\n\n\n\n

Then give the new user a password<\/p>\n\n\n\n

passwd nextcloud<\/pre>\n\n\n\n

Add the user to the wheel group to be able to invoke administrative privileges.<\/p>\n\n\n\n

usermod -aG wheel nextcloud<\/pre>\n\n\n\n

Then prevent root login by editing the \/etc\/ssh\/sshd_config<\/tt> file and set PermitRootLogin to no<\/p>\n\n\n\n

nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n
PermitRootLogin no<\/pre>\n\n\n\n

Exit the editor and restart SSHD service. Once the reboot process is finished, disconnect and log back into with the new username<\/p>\n\n\n\n

ssh nextcloud@<your-ip-address><\/span><\/pre>\n\n\n\n

CentOS 8 offers some security protection when SE Linux is enabled. The primary purpose of SE Linux is to control file access permissions by following the principle of least privilege so that programs only access files that they need to. This is especially helpful when running a service such as NextCloud, but it does increase the complexity of the setup.<\/p>\n\n\n\n

We will change SE Linux from permissive mode to enforcing mode by setting the SELINUX=enforcing<\/tt><\/p>\n\n\n\n

sudo nano \/etc\/selinux\/config<\/pre>\n\n\n\n
SELINUX=enforcing<\/pre>\n\n\n\n

Then save the file and exit the editor.<\/p>\n\n\n\n

The changes will be applied at the next reboot but to save time, you can change the setting for the runtime using the command below.<\/p>\n\n\n\n

sudo setenforce enforcing<\/pre>\n\n\n\n

If you then check that SELinux mode.<\/p>\n\n\n\n

sestatus<\/pre>\n\n\n\n

The output should then give the following.<\/p>\n\n\n\n

SELinux status:               enabled\nSELinuxfs mount:              \/sys\/fs\/selinux\nSELinux root directory:       \/etc\/selinux\nLoaded policy name:           targeted\nCurrent mode:                 enforcing\nMode from config file:        permissive\nPolicy MLS status:            enabled\nPolicy deny_unknown status:   allowed\nMemory protection checking:   actual (secure)\nMax kernel policy version:    31<\/pre>\n\n\n\n

Lastly, update the installed software<\/p>\n\n\n\n

sudo dnf -y update<\/pre>\n\n\n\n

Once done, continue below with the next step.<\/p>\n\n\n\n

Configuring a domain name<\/h2>\n\n\n\n

You will need to configure a valid domain name to point to your cloud server IP address to be able to obtain SSL certificates as described later in this guide. If you do not have a domain name, you can use Freenom<\/a> to get a free temporary domain name.<\/p>\n\n\n\n

You can read more about domain name systems and how to configure DNS records to point your domain to the correct IP address at our guide to domain names<\/a>.<\/p>\n\n\n\n

Installing NGINX webserver<\/h2>\n\n\n\n

Next, we\u2019ll install NGINX to work as the underpinnings of our NextCloud server.<\/p>\n\n\n\n

But first, add the EPEL repository which<\/p>\n\n\n\n

sudo dnf -y install epel-release<\/pre>\n\n\n\n

Then update the repositories and install Nginx<\/p>\n\n\n\n

sudo dnf -y install nginx<\/pre>\n\n\n\n

Verify the installation<\/p>\n\n\n\n

sudo nginx -v<\/pre>\n\n\n\n

should give an output similar to<\/p>\n\n\n\n

nginx version: nginx\/1.14.1<\/pre>\n\n\n\n

Enable (ensure Nginx automatically starts upon reboot) and start Nginx<\/p>\n\n\n\n

sudo systemctl enable nginx\nsudo systemctl start nginx<\/pre>\n\n\n\n

Check Nginx is running<\/p>\n\n\n\n

curl -I 127.0.0.1<\/pre>\n\n\n\n

which should give an output similar to<\/p>\n\n\n\n

HTTP\/1.1 200 OK\nServer: nginx\/1.14.1\nDate: Thu, 30 Jul 2020 16:34:40 GMT\nContent-Type: text\/html\nContent-Length: 4057\nLast-Modified: Mon, 07 Oct 2019 21:16:24 GMT\nConnection: keep-alive\nETag: \"5d9bab28-fd9\"\nAccept-Ranges: bytes<\/pre>\n\n\n\n

Create a firewall rule to allow web access<\/p>\n\n\n\n

sudo firewall-cmd --zone=public --add-service=http --permanent\nsudo firewall-cmd --zone=public --add-service=https --permanent\nsudo firewall-cmd --reload<\/pre>\n\n\n\n

Getting Let’s Encrypt certificates<\/h2>\n\n\n\n

Edit Nginx configuration to indicate the domain name<\/p>\n\n\n\n

sudo nano \/etc\/nginx\/nginx.conf<\/pre>\n\n\n\n

Change the server name to use your domain, replace the my.domain.com<\/span> with yours.<\/p>\n\n\n\n

server_name my.domain.com www.my.domain.com<\/span>;<\/pre>\n\n\n\n

Afterwards, save and exit.<\/p>\n\n\n\n

Then reload NGINX to apply the changes.<\/p>\n\n\n\n

sudo systemctl reload nginx<\/pre>\n\n\n\n

Next, install Certbot which will automate setting up the certificate.<\/p>\n\n\n\n

sudo dnf install -y certbot python3-certbot-nginx<\/pre>\n\n\n\n

Then obtain the certificates with the following command. Replace the my.domain.com<\/span> again with yours.<\/p>\n\n\n\n

sudo certbot --nginx -d my.domain.com<\/span><\/pre>\n\n\n\n

On the first run, you\u2019ll need to provide Certbot with some details.<\/p>\n\n\n\n