To install Nextcloud on Ubuntu or other Linux use command:
sudo snap install nextcloud
After installation snap package check installation status
sudo snap changes nextcloud
To change default http and https ports use commands:
sudo snap set nextcloud ports.http=81
sudo snap set nextcloud ports.https=444
In Nginx proxy server configuration file change proxy_pass default port to 81:
Nextcloud’s automatic hostname detection can fail when behind a proxy; you might notice it redirecting incorrectly. If this happens, override the automatic detection (including the port if necessary), e.g.:
If You use Nginx as https frontend and nextcloud as http backend – You neet co change /var/snap/nextcloud/20498/nextcloud/config.php insert the foloving lines:
In Nginx http config file insert 301 redirect to https:
return 301 https://example.host$request_uri;
By default, PHP will use 128M as the memory limit. If you notice images not
getting previews generated, or errors about memory exhaustion in your Nextcloud
log, you may need to set this to a higher value.
If you’d like to set the memory limit to a higher value (say, 512M), run:
sudo snap set nextcloud php.memory-limit=512M
To set it to be unlimited (not recommended), use -1:
sudo snap set nextcloud php.memory-limit=-1
By default the cronjob interval is 15 minutes. To adjust it (say, 10 minutes) simply run:
sudo snap set nextcloud nextcloud.cron-interval=10m
Rescan all files for all users with occ console command:
git clone https://github.com/petranikin/mgrvphp.git
cd mgrvphp
bash mgrvphp
Then enter version of PHP You need to install (remember that you need to enter fool version: 7.1.4). All versions of PHP You can see on site: http://php.net/releases
Install packages and dependencies: Yes
Create links in /usr/bin : Yes
Create template in VestaCP: Yes
Then wait when script install PHP on Your server (it took me more than 30 minutes)
Once the installation is complete, you can go to the panel to install the desired template:
How to check PHP version on server and site?
Create the file phpinfo.php. Open it with a text editor and enter the following:
‹?php
phpinfo();
?›
Upload the file to the root of the site → open the file in the browser and look at the installed version of php: