Product docs and API reference are now on Akamai TechDocs.
Search product docs.
Search for “” in product docs.
Search API reference.
Search for “” in API reference.
Search Results
 results matching 
 results
No Results
Filters
Store and Share your Files with Nextcloud on CentOS 7
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Before You Begin
If you have not already done so, create a Linode account and Compute Instance. See our Getting Started with Linode and Creating a Compute Instance guides.
Follow our Setting Up and Securing a Compute Instance guide to update your system. You may also wish to set the timezone, configure your hostname, create a limited user account, and harden SSH access.
Install the EPEL repository:
yum install epel-release -y
Install MariaDB Database Server
Add the MariaDB 10.2 repository to force yum to install the latest version:
- File: /etc/yum.repos.d/MariaDB.repo
[mariadb] name = MariaDB-10.2.3 baseurl = http://yum.mariadb.org/10.2.3/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
Install MariaDB and enable the service on system startup:
yum install mariadb mariadb-server -y systemctl start mariadb systemctl enable mariadb
Set up the MariaDB server with the
mysql_secure_installation
script. Respond to the prompts with the replies shown below:mysql_secure_installation Enter current password for root (enter for none): ENTER Set root password? [Y/n] Y 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
Create a database and user for Nextcloud in MariaDB. Login as
root
and enter the password set earlier. Be sure to create a strong password to replace theCREATE-PASSWORD-HERE
text:mysql -u root -p MariaDB [(none)]> CREATE DATABASE nextcloud; MariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'CREATE-PASSWORD-HERE' WITH GRANT OPTION; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> quit
Install Apache Web Server
Install Apache and enable the service on system startup:
yum install httpd -y systemctl start httpd systemctl enable httpd
Disable Apache’s WebDAV modules to prevent conflict with Nextcloud’s WebDAV modules:
sudo sed -i 's/^/#&/g' /etc/httpd/conf.modules.d/00-dav.conf
Restart Apache to reflect changes:
systemctl restart httpd
Install PHP 7.1 and Required Modules
Add the Remi repository:
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Install the yum-utils package:
yum install yum-utils -y
Update the system to populate the Remi repository:
yum update -y
Direct the system to use PHP 7.1 and issue installation command:
yum-config-manager --enable remi-php71 yum install php71-php php-mbstring php-zip php71-php-opcache php71-php-mysql php71-php-pecl-imagick php71-php-intl php71-php-mcrypt php71-php-pdo php-ZendFramework-Db-Adapter-Pdo-Mysql php71-php-pecl-zip php71-php-mbstring php71-php-gd php71-php-xml -y
The default file upload size PHP will allow is 2MB. Increase (or decrease) the allowed file size to your preferred value. The example below will set a 512MB file upload size and no limit for the post size:
sudo cp /etc/php.ini /etc/php.ini.bak sudo sed -i "s/post_max_size = 8M/post_max_size = 0/" /etc/php.ini sudo sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 512M/" /etc/php.ini
Restart Apache:
systemctl restart httpd
Install Nextcloud 12
Check the Nextcloud download page for the latest version and replace
12.0.4
in the command below with the appropriate version number:cd /opt sudo yum install wget wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.zip
Unzip the package:
sudo yum install unzip unzip nextcloud-x.y.z.zip
Move the entire unzipped Nextcloud folder to the root web directory and grant permissions to the
apache
user for all contents:cp -r nextcloud /var/www/html
Grant permissions to the Nextcloud folder and all its contents to the Apache user. Determine which user Apache is running with the first command below. Replace
apache:apache
in the second command with the output if it differs:ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | groups $(awk '{print $1}') chown apache:apache -R /var/www/html/nextcloud
Navigate to the
nextcloud
root web directory, and complete the Nextcloud installation:cd /var/www/html/nextcloud sudo -u apache php occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "nextclouduser" --database-pass "yourpassword" --admin-user "admin" --admin-pass "adminpassword"
If the installation is successful, you will receive the following message:
Nextcloud was successfully installed
Since these files are now internet-facing, set stronger permissions to improve security:
find /var/www/html -type f -print0 | sudo xargs -0 chmod 0640 find /var/www/html -type d -print0 | sudo xargs -0 chmod 0750
Update the URL in the
config.php
file to accommodate thenextcloud
subfolder added within the document root. Match theoverwrite.cli.url
andhtaccess.RewriteBase
lines:- File: /var/www/html/nextcloud/config/config.php
1 2 3 4 5 6 7 8 9 10 11
. . . ), 'datadirectory' => '/var/www/html/nextcloud/data', 'overwrite.cli.url' => 'http://localhost/nextcloud', 'htaccess.RewriteBase' => '/nextcloud', 'dbtype' => 'mysql', 'version' => '12.0.3.3', 'dbname' => 'nextcloud', . . .
Update the
.htaccess
file with the URL changes:sudo -u apache php /var/www/nextcloud/occ maintenance:update:htaccess
Navigate to
your-Linode-IP-address/nextcloud
(replaceyour-Linode-IP-address
) and the Nextcloud page should load with a login page for the admin user you created earlier.To check the status of your Nextcloud environment, use the following
occ
command:sudo -u apache /var/www/html/nextcloud/ php occ status
Where to Go from Here
Once you have successfully installed you Nextcloud environment, you may want to further integrate it into an owned domain name or make adjustments to your web server to serve SSL encrypted pages. See Nextcloud’s Enabling SSL guide to enable SSL.
Although Apache was used as the web server in this guide, installing Nextcloud with nginx is possible as well. Navigate to the Nextcloud NGINX Configuration documentation to setup Nextcloud with NGINX.
Nextcloud Talk , is an addon to Nextcloud that allows for secure text and video conferencing through Nextcloud’s platform. Check out our guide on how to Install Nextcloud Talk .
More Information
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on