Toggle navigation

NextCloud Image Guide

Version 12.0.4

Websoft9 NextCloud is a pre-configured, ready to run image for running NextCloud on Alibaba Cloud.

Nextcloud, the next generation open source Enterprise File Sync and Share was started by ownCloud inventor Frank Karlitschek and a dozen experienced open source entrepreneurs and engineers to empower users to take back control over their data and communication.

Application Software(NextCloud)
Software directory: /data/wwwroot/nextcloud

Infrastructure(PHP7.0,APACHE2.4)
PHP Configuration File: /etc/php.ini
Default Apache Vhost Configuration File: /etc/httpd/conf.d/vhost.conf
Apache Vhost Configuration directory: /etc/httpd/conf.d
Apache Log Files: /var/log/httpd

Database(MYSQL5.6)
Database install directory: /usr/share/mysql
Database data directory:  /data/mysql
Database Configuration File: /etc/my.cnf
PhpMyAdmin install directory: /usr/share/phpmyadmin

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address and you can enter the installation page directly,if there no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

Three usernames and passwords are required for application installation, application using, andapplication maintenance:

1、NextCloud:Username and Password is set by youself when installation,
2、MySQL Database:Default username and password is root/123456
Control Panel URL:http://Internet IP Address/phpmyadmin


3、Linux Server:Username is root,Password is set by youself when buying.
Please Using the Putty for ssh remote and WinSCP for SFTP

Note:You can reset the password of OS through Cloud Console if you have forgotten it

It is recommended to complete two steps before the the installation:

  • Complete the Domain resolution if you want to use domain for this application
  • Modify the MySQL password of root through http://Internet IP Address/phpmyadmin

Then access the installation page and complete the installation wizard for the following steps:

  1. Local Chrome or Firefox to visit http://yourdomain or http://Internet IP Address
  2. Then enter the configuration inerface of installation(the account of mysql please refer to Will be used Usernames and Passwords)
  3. It has been installed successfully

  4. Shut down that Pop-up Windows,you can enter the backend of NextCloud

NextCloud Marketplace includes hundreds of free apps and connect services you use to NextCloud,you can use apps to extend functions,themes

Routine backup (archives) of the database and application setup is essential to ensure failover is smooth.

Backup is based on the server snapshot automatic backup,manual local backup,using plugin to backup in three ways, three of which have their own advantages and disadvantages, it is recommended to use together

Automatic Backup by Snapshot of Server

IaaS provider have the “snapshot” function for Server, the snapshot is for the server disk. Snapshot tool can record the specified point in time the hard disk data, all backed up, and can achieve a key recovery.

If you have an automatic snapshot of the disk settings, the following scenes you can be more calm face:

  • Work a few days of the results, was mistakenly deleted
  • Hackers damage your site
  • The content has been messed up

Done a snapshot backup, a key to restore to the backup point of time state. That is, on-site reduction, very good function.

Different cloud vendor snapshot settings slightly different, specific reference:

Backup APPS

You can  install the “OwnBackup” app ( install it first) you can backup use interface

  1. Find and intall the OwnBackup app
  2. Admin->Additional settings->OwnBackup
  3. Click the “Create Backup”-Yes,backup successful

You should always maintain regular backups and make a fresh backup before every upgrade.

Upgrading NextCloud with the Updater App

The NextCloud have intalled the apps Updater which can help upgrade NextCloud online.

  • NextCloud->Admin->Basic settings->Version,If you have new edition for upgrade,you can see the information about upgrade,then click the button “Open updater”
  • Click the “start update”  to start

Manual NextCloud Upgrade

This solution is coming soon…

Go to admin->Settings->Personal,you can set you language

Use SFTP you can mange file,upload and download file,configure Server.

  1. Start WinSCP. Login Dialog will appear.
  2. Then select your File protocol(SFTP) on the dialog
  3. Enter your host name to Host name field, username to User name and password to Password like below
  4. You may want to save your session details to a site so you do not need to type them in every time you want to connect. Press Save button and type site name.
  5. When appear the dialog below,please select the “yes”
  6. You can manane Linux file below
  7. WinSCP can integrate the Putty and transfer the log in information to Putty
  8. Now you can use Putty(Not need to log in) from the menu bar of WinSCP

Connect to a Linux instance using Windows OS

This section uses PuTTY as an example. PuTTY can be downloaded here.

You can connect to a Linux instance via PuTTY as follows:

  1. Start Putty.exe.
  2. Enter the public IP address of the instance in Host Name (or IP address).
  3. Use the default port 22.
  4. Select SSH as Connection Type.
  5. Type a session name in Saved Sessions, and then click Save. In later logins, you may directly load the session without re-entering the IP address.
  6. Click Open to connect.
  7. Upon first connection, the following dialog box will be displayed. Click Yes.
  8. As prompted, enter the username and password for the Linux ECS instance. The password will not be displayed on-screen. Press the Enter key to complete connection to the instance.

When you connect your computer to the Linux instance successfully, you can operate the instance from your computer.

Following is the step for access phpMyadmin

  1. Open Chrome or Firefox on your local PC
  2. visit the http://Internet IP Address/phpMyAdmin,you can enter the login page
  3. select you language,Username:root,Password:123456
  4. Click the button “Go”

The PHP configuration file allows you to configure the modules enabled, the email settings or the size of the upload files. It is located at /etc/php.ini.

There are some PHP settings that need to be sufficient when running your application,The values for PHP.ini below are suggested values only.

  • memory_limit – Minimum: 128M Recommended: 512M or better
  • upload_max_filesize – Minimum: 20M
  • post_max_size – Minimum: 20M
  • max_execution_time: At Least 120 Recommended: 300

After modifying the PHP configuration file, restart both Apache and PHP-FPM for the changes to take effect:

# systemctl restart httpd

How to modify the allowed limit for upload?

Modify the  /etc/php.ini file to increase the allowed size for uploads:

; Maximum size of POST data that PHP will accept.
post_max_size = 16M
; Maximum allowed size for uploaded files.
upload_max_filesize = 16M

then,restart the apache

# systemctl restart httpd

How to change the max_execution_time?

If you receive the message “Maximum execution time of 30 seconds exceeded”.You may also like to extend the max_execution_time for PHP and you can modify it by two methods below

Method one: edit your  /etc/php.ini


; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 90
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.

Method two: edit your .htaccess:


<IfModule mod_php5.c>
php_value max_execution_time 90
</IfModule>

Apache http service

~# systemctl start httpd
~# systemctl stop httpd
~# systemctl restart httpd

MySQL  service

~# systemctl start mysqld
~# systemctl stop mysqld
~# systemctl restart mysqld

Use domain you should complete the following steps:

Step One:Domain resolution

Domain Name Resolution indicates the way your domain names are resolved to their mapped IP address. The majority of resolutions from domain names to IP addresses are done through a procedure called DNS. After the resolution, the domain name can be used to access Internet in a much more convenient way.

You can use Alibaba Cloud DNS in sync with the Domain service. Alibaba Cloud DNS provides authoritative DNS servers and DNS management services.

  1. Login Cloud Console->DNS Settings->Add Record,set Domain Resolution:
  2. The type is A record,host is your sub domain,value is your Internet IP Address.Confirm it
    Host use @ to exactly match the original domain name (for example, yourdomain.tld).
  3. After the Domain Name Resolution please waite for some time until it’s useful(This time is different for different provider of Domain,from 1 minute to 24h)

Note:Please clear the browser cache when Domain Name Resolution is useful but you browser seem is also feedback the old contents of your site

Step Two:Modify the Vhost file

  1. Using SFTP to edit the /ect/httpd/conf.d/vhost.conf
  2. Modify the domain related information like below,then save it
    <VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias mydomain.com
  3. Using putty to run the command “systemctl restart httpd”

When install new extension from back-end it will not successful,may be the permissions of file and folder is not appropriate,you should change it

Web site root permissions to follow:
file 0644/ folder 0755 Permissions Users and groups apache/apache
If there is a file permissions problem, execute the following three commands:

~# chown -R apache.apache /data/wwwroot/joomla
~# find /data/wwwroot/joomla -type d -exec chmod 755 {} \;
~# find /data/wwwroot/joomla -type f -exec chmod 644 {} \;

This Image supports the deployment of multiple applications (Web sites), following is the steps for adding new application:

  1. Using the SFTP to add new folder named “NewSite ” and upload the entire codes of application to /data/wwwroot/newsite
  2. Change the permissions of filesytem for NewSite folder
  3. Using SFTP to enter the /ect/httpd/conf.d directory,add new conf file,e.g. File name is www.newsite.com.conf
  4. Copy the following content to www.newsite.com.conf and modify the the domain part if needed,then save it
<VirtualHost *:80>
ServerName www.newsite.com
ServerAlias newsite.com
DocumentRoot "/data/wwwroot/default/newsite"
ErrorLog "/var/log/httpd/www.newsite.com_error_apache.log"
CustomLog "/var/log/httpd/www.newste.com_apache.log" common
<Directory "/data/wwwroot/default/newsite">
Options Indexes FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

If you have no domain or you don’t want to use domain,you should copy the following contents to conf file on step”4″:

Alias /mysite "/data/wwwroot/default/newsite"   
 <Directory "/data/wwwroot/default/newsite">
	        Options Indexes FollowSymlinks
	        AllowOverride All
	        Require all granted
	    </Directory>

Run the “systemctl restart httpd ” command,visit the URL http://www.newsite.com or http://ip/newsite to run Installation Wizard of new site

Note:Apache configuration rules and syntax is very flexible, the above is for reference only

This document is original from Websoft9.In order to ensure the seriousness and usability of the documentation, no one may misappropriate or modify the second distribution. The need for friends reproduced please mark the source, otherwise we reserve the right to give legal action.

We will periodically update the documentation. Please visit the online documentation for the latest version

This document URL: http://en.websoft9.com/xdocs/nextcloud-image-guide/
Support & Partnership: http://www.websoft9.com

Need more same solution like Nextcloud,please read:Best DIY Cloud Storage Tools