• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Setup Nextcloud file sharing Server in CentOS 7

{{postValue.id}}

To Setup Nextcloud file sharing Server in CentOS 7

Nextcloud is an open source tool that grant permission to share and sync the files and folders in any cloud storage device. Here the Nextcloud server will be the centralized storage for all the clients. Installation of file sharing server in CentOS is explained in this article.

Use the following command to compose a LAMP Server.

[root@linuxhelp ~]# yum install httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl php-mcrypt php-pear mariadb-server mariadb -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * epel: epel.mirror.net.in
 * extras: centos.webwerks.com
 * updates: mirror.nbrc.ac.in
Resolving Dependencies
-->  Running transaction check
--->  Package curl.x86_64 0:7.29.0-19.el7 will be updated
--->  Package curl.x86_64 0:7.29.0-25.el7.centos will be an update
-->  Processing Dependency: libcurl = 7.29.0-25.el7.centos for package: curl-7.29.0-25.el7.centos.x86_64
--->  Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed
.
.
.
Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7                  apr-util.x86_64 0:1.5.2-6.el7           httpd-tools.x86_64 0:2.4.6-40.el7.centos.4         libmcrypt.x86_64 0:2.5.8-13.el7                  
  libzip.x86_64 0:0.10.1-8.el7              mailcap.noarch 0:2.1.41-2.el7           perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7       perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7      
  perl-DBD-MySQL.x86_64 0:4.023-5.el7       perl-DBI.x86_64 0:1.627-4.el7           perl-Data-Dumper.x86_64 0:2.145-3.el7              perl-IO-Compress.noarch 0:2.061-2.el7            
  perl-Net-Daemon.noarch 0:0.48-5.el7       perl-PlRPC.noarch 0:0.2020-14.el7       php-cli.x86_64 0:5.4.16-36.1.el7_2.1               php-process.x86_64 0:5.4.16-36.1.el7_2.1         
  t1lib.x86_64 0:5.1.2-14.el7              

Updated:
  curl.x86_64 0:7.29.0-25.el7.centos                                                            sqlite.x86_64 0:3.7.17-8.el7                                                           

Dependency Updated:
  libcurl.x86_64 0:7.29.0-25.el7.centos                                                       mariadb-libs.x86_64 1:5.5.47-1.el7_2                                                      

Complete!

Start and enable the services, after the LAMP installation.

[root@linuxhelp ~]# systemctl start httpd
[root@linuxhelp ~]# systemctl enable httpd
ln -s ' /usr/lib/systemd/system/httpd.service'  ' /etc/systemd/system/multi-user.target.wants/httpd.service' 
[root@linuxhelp ~]# systemctl start mariadb
[root@linuxhelp ~]# systemctl enable mariadb
ln -s ' /usr/lib/systemd/system/mariadb.service'  ' /etc/systemd/system/multi-user.target.wants/mariadb.service' 

Fix the root password for the database by using the following command.

[root@linuxhelp ~]# mysql_secure_installation 
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

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): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
.
.
.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... 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!

Then construct the database and user for nextcloud setup.

[root@linuxhelp ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 10
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.

MariaDB [(none)]>  create database nextcloudb 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>  grant all on nextclouddb.* to ' nxtuser' @' localhost'  identified by ' centos7'  
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  FLUSH PRIVILEGES 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  exit
Bye

Download Nextcloud package by using the wget command.

[root@linuxhelp ~]# wget https://download.nextcloud.com/server/releases/nextcloud-9.0.53.tar.bz2
--2016-07-28 18:29:16--  https://download.nextcloud.com/server/releases/nextcloud-9.0.53.tar.bz2
Resolving download.nextcloud.com (download.nextcloud.com)... 88.198.160.133
Connecting to download.nextcloud.com (download.nextcloud.com)|88.198.160.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28549436 (27M) [application/x-bzip2]
Saving to: ‘ nextcloud-9.0.53.tar.bz2’ 

100%[==============================================================================================================================================> ] 28,549,436   419KB/s   in 74s    

2016-07-28 18:30:33 (375 KB/s) - ‘ nextcloud-9.0.53.tar.bz2’  saved [28549436/28549436]

Unwind the downloaded tar package.

[root@linuxhelp ~]# tar -xjvf nextcloud-9.0.53.tar.bz2 
nextcloud/
nextcloud/ocs/
nextcloud/ocs/routes.php
nextcloud/ocs/v2.php
nextcloud/ocs/v1.php
nextcloud/ocs/providers.php
nextcloud/console.php
.
.
.
nextcloud/resources/config/
nextcloud/resources/config/mimetypemapping.dist.json
nextcloud/resources/config/ca-bundle.crt
nextcloud/resources/config/mimetypealiases.dist.json
nextcloud/resources/codesigning/
nextcloud/resources/codesigning/root.crt
nextcloud/resources/codesigning/core.crt
nextcloud/resources/codesigning/owncloud.crt

Transfer the unwinded package to the default root directory.

[root@linuxhelp ~]# ls
anaconda-ks.cfg  Desktop  Documents  Downloads  initial-setup-ks.cfg  Music  nextcloud  nextcloud-9.0.53.tar.bz2  Pictures  Public  Templates  Videos
[root@linuxhelp ~]# mv nextcloud /var/www/html/

Switch the ownership for the nextcloud directory as ' apache' .

[root@linuxhelp ~]# chown -R apache:apache /var/www/html/nextcloud/

Empower the ports in the firewall as shown below to allow the clients to access the nextcloud.

[root@linuxhelp ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@linuxhelp ~]# firewall-cmd --permanent --zone=public --add-service=https 
success
[root@linuxhelp ~]# firewall-cmd --reload 
success

To disable the selinux either run the following command,

[root@linuxhelp ~]# setenforce 0

Or Open the selinux config file and add the following entry.

[root@linuxhelp ~]# vim /etc/sysconfig/selinux
SELINUX=permissive

Open the browser and call the URL http://IP_address/nextcloud">http://< IP_Address> /nextcloud

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-Open-browser
Create Admin account and click Finish setup.

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-Admin-account
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-dashbord
To create new folder, click " +" (add) icon.

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-new-folder-add
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-folder
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-name
Open the created folder and add a sample text file.
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-Open-created-folder
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-add
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-text-file
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-sample.txt
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-sample.txt-open
To add a new user, Go to Admin &rarr Users
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-Users

Click create button.
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-create
To share the folder with specified user, select the folder.

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-share-folder

Click Share icon and choose the user.snap 15

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-Share
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-user.snap15
Click share link to share a link of the folder.
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-share-link
Now lets check it by accessing the nextcloud server with user name.
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-access-nextcloud-server

Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-user-name
Setup-Nextcloud-file-sharing-Server-CentOS7-grant-permission-to-share-sync-files-folders-in-cloud-storage-device-centralized-storage-for-clients-files

Tags:
wyatt
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How do I connect with SSH to NextCloudPi?

A

There are three ways.

From ncp-web, activate SSH from the SSH option.
(Rpi only) You can place an empty file named ssh in the boot partition of the sd card (so /boot/ssh)

Q

What are pre-set users/passwords on NextCloudPi?

A

There are no pre-set passwords, the following are randomly generated upon first access during activation.

For terminal pi/raspberry (root/1234 on Armbian)
For SSH: generated on demand on ncp-web SSH section.

Q

How do I login as another user in mysql?

A

Replace the username "root" with the username you have

Q

How do I set up Let's Encrypt with blocked ports?

A

If you only have port 443 available, you can use the following workaround: copy that code and after that try again from the web interface or nextcloudpi-config

Q

How to access from outside your network in nextcloud?

A

Navigate to nc-forward-ports in the TUI or the WebUI.
Set the ports your Nextcloud runs on.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Gibbson ?
How do i run both nginx and apache in same instance on centos

Hi...,

my server is based centos operating system and my webserver is already running on Apache.... i need to run both apache and nginx on same instance ... please help me to implement this concept...

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.