How to Install NextCloud AIO on a Vultr Cloud Server

Updated on October 21, 2022
How to Install NextCloud AIO on a Vultr Cloud Server header image

Introduction

Nextcloud AIO (All in one) is a complete suite of Nextcloud application features that are easy to deploy and configure on a server. Nextcloud AIO deploys in a Docker container and includes the following features upon installation.

  • Nextcloud server
  • Imaginary
  • Full-text search
  • ClamAV anti-virus
  • Nextcloud Collabora Office supporting documents, presentations, spreadsheets, and PDF files
  • Automatic backups powered by BorgBackup
  • High-performance Nextcloud Files
  • High performance for Nextcloud Talk

This article explains how you can install NextCloud AIO on a Vultr Cloud Server running Docker.

Prerequisites

Install Nextcloud AIO

  1. Add your sudo user account to the docker group.

      $ sudo adduser example-user docker
  2. Install the Nextcloud AIO master container. Replace 9000 with your desired port number.

      $ sudo docker run -d \
        --sig-proxy=false \
        --name nextcloud-aio-mastercontainer \
        --restart always \
        --publish 8080:8080 \
        -e APACHE_PORT=9000 \
        -e APACHE_IP_BINDING=127.0.0.1 \
        --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
        --volume /var/run/docker.sock:/var/run/docker.sock:ro \
        nextcloud/all-in-one:latest
  3. Verify that the Nextcloud container status is up and healthy.

      $ sudo docker ps

    Output:

      CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS                    PORTS                                                         NAMES
      67c93b8b004b   nextcloud/all-in-one:latest        "start.sh /usr/bin/s…"   3 minutes ago   Up 3 minutes (healthy)   80/tcp, 8443/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   nextcloud-aio-mastercontainer   

Setup Nginx as a Reverse Proxy

  1. Create a new Nginx configuration file.

      $ sudo touch /etc/nginx/conf.d/nextcloud.conf
  2. Using a text editor of your choice, open and edit the file.

    $ sudo nano /etc/nginx/conf.d/nextcloud.conf
  3. Add the following configurations to the file. Replace nextcloudaio.example.com with your actual domain name.

     server {
         listen 80;
         listen [::]:80;
    
         server_name nextcloudaio.example.com;
    
         location / {
             proxy_pass http://localhost:9000;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header Host $host;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             client_max_body_size 0;
    
             # Websocket
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
         }
    
     }

    Save and close the file.

  4. Check the Nginx configuration for errors.

      $ sudo nginx -t
  5. Restart Nginx to save changes.

      $ sudo systemctl restart nginx

Security

By default, the Uncomplicated Firewall (UFW) is active on Vultr Ubuntu servers. Configure the firewall to allow the Nextcloud master container port 8080, HTTP, and HTTPS access on the server.

  1. Verify that UFW is up and running.

      $ sudo ufw status

    The UFW firewall table should display, if the status is inactive, allow the SSH port 22 and start the firewall.

      $ sudo ufw allow 22/tcp && sudo ufw enable 
  2. Allow the Nextcloud master container port 8080.

      $ sudo ufw allow 8080/tcp
  3. Allow the Nextcloud Talk container ports.

      $ sudo ufw allow 3478/tcp && sudo ufw allow 3478/udp
  4. Allow the HTTP port 80.

      $ sudo ufw allow 80/tcp
  5. Allow HTTPS on port 443.

      $ sudo ufw allow 443/tcp
  6. Restart the firewall to save changes.

      $ sudo ufw reload

Generate SSL certificates

Nextcloud AIO requires a valid SSL certificate to run on your domain. Generate a free Let's Encrypt certificate using Certbot and add it to your Nginx configuration file as described in the steps below.

  1. Verify that the Snap daemon is up to date.

      $ sudo snap install core; sudo snap refresh core
  2. Install the Certbot Let's Encrypt tool.

      $ sudo snap install --classic certbot
  3. Enable the system-wide Certbot command.

      $ sudo ln -s /snap/bin/certbot /usr/bin/certbot
  4. Generate a new SSL certificate for your domain. Replace nextcloudaio.example.com with your active domain name and user@example.com with your actual email address.

      $ sudo certbot --nginx -d nextcloudaio.example.com -m user@example.com --agree-tos
  5. Test SSL certificate auto-renewal.

      $ sudo certbot renew --dry-run
  6. Verify that your Nginx file includes new SSL configurations added by Certbot.

      $ cat /etc/nginx/conf.d/nextcloud.conf
  7. Restart Nginx to save changes.

      $ sudo systemctl restart nginx

Configure Nextcloud AIO

  1. Using a web browser such as Google Chrome, visit your direct server IP on port 8080. Replace 192.0.2.1 with your actual server address.

      https://192.0.2.1:8080

    Your browser may display a Your connection is not private prompt, show Advanced, then click Proceed to (unsafe).

    If the Proceed to (unsafe) option is missing, click anywhere on the page, and enter this is unsafe to clear the error.

  2. On the Nextcloud AIO setup page, select and copy the 8-word password to your clipboard.

    Nextcloud AIO setup page

  3. Click Open your Nextcloud AIO login.

  4. Paste your password on the Nextcloud AIO Login page, and click Log in to proceed.

  5. In the New AIO instance field, enter your domain name and click Submit to test your reverse proxy settings.

  6. Review the Optional addons list, and select Nextcloud features you wish to enable.

  7. Scroll down to the Timezone change section, enter your server timezone, and click Submit.

  8. Click Start containers to begin installing Nextcloud and all selected addons on the server.

    Nextcloud AIO Addons list

  9. When the installation is complete, copy the generated Initial Nextcloud password to your clipboard, and click Open your Nextcloud, or visit your domain name nextcloudaio.example.com directly.

  10. Login to your Nextcloud server with the username admin, and paste your initial password.

  11. Skip through the Nextcloud Hub II tutorial, and access the Nextcloud dashboard.

  12. Click your username A icon in the top right corner, and click Settings from the drop-down list.

    Access Nextcloud Settings

  13. Click Security on the left navigation menu.

  14. Enter your Current password, and a strong New password in the appropriate field, then click Change Password.

  15. To set up new Users, click your username in the top right corner and select users from the drop-down list.

  16. Click + New user, or + Add group to set up new users and groups as you may prefer.

  17. Click Dashboard on the main navigation bar, and start using all Nextcloud features.

Troubleshooting

While accessing the Nextcloud master container interface, you may receive the following errors upon entering your domain name in the New AIO instance field.

  1. Domain does not point to this server or the reverse proxy is not configured correctly. See the mastercontainer logs for more details. ('sudo docker logs -f nextcloud-aio-mastercontainer')

    Verify that Nginx is up and running.

      $ sudo systemctl status nginx

    Test your Nginx configuration for errors.

      $ sudo nginx -t

    Open your Nginx configuration file and confirm that the proxy_pass http://localhost:9000; directive matches your Nextcloud apache port, this article uses port 9000.

        $ sudo nano /etc/nginx/conf.d/nextcloud.conf
  2. The server is not reachable on Port 443. You can verify this e.g. with 'https://portchecker.co/' by entering your domain there as ip-address and port 443 as port.

    Verify that the HTTPS port 443 is open on the UFW firewall table.

      $ sudo ufw status

    View your Nginx configuration file and verify that the Certbot SSL configuration directives exist at the end of the file.

       $ cat /etc/nginx/conf.d/nextcloud.conf

    Your directives should look like the ones below.

      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/nextcloudaio.example.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/nextcloudaio.example.com/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
      }

    Restart Nginx to refresh your SSL configurations.

      $ sudo systemctl restart nginx

Next Steps

You have installed Nextcloud AIO (All in One) on a Vultr Cloud server. To enable more features on your Nextcloud server, refer to the following articles.