Comments on How to Install Nextcloud with Nginx on Ubuntu 18.04 LTS

In this tutorial, we will show you how to install and configure the latest Nextcloud 13.0.2 release on an Ubuntu 18.04 server. We will run Nextcloud with a Nginx web server and PHP7.1-FPM and use MySQL server as the database system. Nextcloud is a free (Open Source) Dropbox-like software, a fork of the ownCloud project.

19 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Quentin

Hi,

 

Is there anyway to do it without https ? I'd like to test on a local virtual server first but I'm stuck at the :

certbot certonly --standalone -d nextcloud.hakase-labs.io

 

Thanks

By: mohammad

If you're using local environment - you can generate self signed certificate files using openssl.

look at the link below.

https://www.howtoforge.com/tutorial/how-to-install-nextcloud-with-nginx-and-php-fpm-on-centos-7/#step-generate-a-selfsigned-ssl-certificate-for-nextcloud

By: Marcelo Oliveira

On step 6, after #nginx -t, returns:

 

root@cloud:/etc/nginx/sites-available# nginx -tnginx: [emerg] BIO_new_file("/etc/letsencrypt/live/nextcloud.hakase-labs.pw/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/nextcloud.hakase-labs.pw/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)nginx: configuration file /etc/nginx/nginx.conf test failed

I followed step by step and am receiving this. Any advice? Only difference is I've utilized the latest version of nextcloud download of 13.0.5 instead of 13.0.2.zip from the previous steps without any other errors.

 

Thanks

By: Eimantas

It is not mentioned anywhere in tutorial, but you need to replace nextcloud.hakase-labs.pw in the given configuration with your vps hostname of your VPS.

By: Jayden

You should update the download URL in your wget command to: https://download.nextcloud.com/server/releases/latest.zip

By: till

That's a good idea, I've changed that in the tutorial.

By: mzorzy

"nextcloud virtual host configuration" can be done under ISPconfig-site-webdomani-option-directive?

how? tnx

 

By: till

No, this won't work. The tutorial above is not for an ISPConfig server. The config shown above is a complete vhost, so you would add it outside of ISPConfig in the way described above. There should be no conflict unless you try to add a website with the same domain name in ISPConfig. The alternative would be to create a website in ISPConfig, upload nextcloud into that website and then add just the location rules to the nginx directives field. If I remember correctly, there is a thread about that in the forum, probably in the priority support sub-forum.

By: stardust

Getting the following error. Ran all updates aslo rebooted. Any tips?

 

Note, selecting 'php7.1-common' instead of 'php7.1-iconv'Some packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: php7.1-mcrypt : Depends: libmcrypt4 but it is not installable php7.1-zip : Depends: libzip4 (>= 1.0) but it is not installableE: Unable to correct problems, you have held broken packages.

 

Thanks

 

By: Maarten

I'm wondering why you are installing version 7.1 of PHP, when version 7.2 of PHP is the default in Ubuntu 18.04 LTS.

By: stardust

I was simply following the instructions. Why? Look at Step 2 - Install and Configure PHP7.1-FPM etc

 

By: Name

Got login loop after installation. There are no errors in the nginx or nextcloud logs. Any idea why?

By: Alex Sharp

I have installed nextcloud and all worked great, running it on ubuntu 18.04 (lubuntu).

however, I hace docker installed and on it I have a container with OnlyOffice, since it runs on the same ip as the NC i have a problem. Since every port that I assign to the Docker Container is getting redirected to nextcloud, please help me to solve and or separate this problem.

Router configuration and port forwarding all okay, but evething opens NC login page..

Thank you!

By: ArturD

Thank you very much for this post!

It took les than 5 minutes to have Nextcloud running on VPS that already had PHP, MySQL and Nginx (one I;m using for Wordpress already)! You saved me a lot of time :-)

By: Ken Dyson

Hi, thanks for the tutorial.

Everything seems to go smoothy for my until I attempt to open the web browser and type the nextcloud URL address.

I configured nginx with the server name as dysoncloud.net.  I am installing it on the local machin with managed DNS (No-Ip).  I ran the configuration client and dysoncloud.net should rediect to 70.82.208.228:3200.  I use port 3200 because my ISP blocks port 80.  I set up the nginx config to listen 3200 default_server listen [::]:3200 default_server.

I set up port forwarding to have my router send 3200 and 443 to the local IP, in this case 192.168.0.29

nextcloud config looks like this:

upstream php-handler {    #server 127.0.0.1:9000;    server unix:/run/php/php7.1-fpm.sock;}server {    listen 3200;    listen [::]:3200;    server_name dysoncloud.net;    # enforce https   return 301 https://$server_name$request_uri;}server {    listen 443 ssl http2;    listen [::]:443 ssl http2;    server_name dysoncloud.net;    ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;    ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

 

I didn't get any errors anywhere along the way.

 

When i go to dysonsphere.net I get a webpage that says:

The site you have requested is currently unavailable, please try back again later.

Any help would be greatly appeciated.

 

Thanks

By: gho

Hi.. thanks for the tutorial..

I have read your tutorial and also interesting for this way. But, before I go to start all of this stuff, I need to know something and let me ask for it. These are the reasons and the questions:

I have a domain name that available on diferent server. I want to try it for Google Cloud VM. In this case, I assume that the name_server will confused me if I do it as your instructions (my.domain.com). Because I have tried the way like this to install phpMyadmin and get fail.  So please give me a clue or something that should I know. Thanks.

 

By: ted

Thanks for the great tutorial. It works seamless.

By: Alex

Hello. Can I change all the things in the command from 7.1 to 7.3 or 7.4?

Updated. I change to 7.4 and there was an error :/

By: koxy

After installation i get 404 error instead of dashboard