Git Product home page Git Product logo

nextcloud-azure's Introduction

Setup Nextcloud on Azure with NFS on Blob Storage

Nextcloud provides a private safe place for all your data. The suite of tools and apps works similarly to Dropbox or OneDrive, which allows you to sync your files to the cloud using a client for your phone or PC. It’s also extensible, allowing for features like a calendar, contacts, chat app, and videoconferencing.

What makes Nextcloud stand apart, however, is it does these functions in a private context. Sure, online apps are secure, but when you install Nextcloud, you control who can see your data and who has access to your data without the prying eyes of hosting providers. Therefore, using Nextcloud means having both a secure and private cloud experience.

Setting up Nextcloud on Azure is straightforward if you only use a VM. There are plenty of recipes on how to do that. Using a VM is suboptimal because if you want any sizable storage capacity, you pay for that capacity in allocated drive space, whether you use it or not. Azure has a few services that scale with usage in Azure Files and Azure Blob Storage. Azure Files is conducive for transactional workloads, like databases and apps that need random access to files, but it costs more. Azure Blob Storage is useful for object storage rather than random file access, which is more the pattern used by an app like Nextcloud.

Historically, you could use Blob Storage with Nextcloud using Blob Fuse. Microsoft more recently introduced NFS for Azure Blob Storage, a much more performant solution for mounting Blob Storage as a part of the file system. NFS, however, has very little inherent security on Azure. Anyone with the endpoint can mount and access the file share, so making any NFS shares on Azure Blob storage a private endpoint and using firewalls built into Azure Storage Accounts and NSGs for VNets to prevent unwanted connections to the private endpoint.

Diagram

I built these automation scripts to make setting this up on Azure easy. One is an ARM template that deploys a VM, a Storage Account with Blob Storage with NFS enabled, and the private connectivity between the VM and the Storage Account using VNets, Private Endpoints, etc. The shell does three things. First, it mounts the Storage Account into the VM. Second, it sets up Nextcloud and its dependencies on the VM (Apache, MariaDB, PHP, etc.) Third, the script sets up a Let’s Encrypt certificate for the VM. You can click on the button below to deploy the script using the Azure Portal.

You’ll need a few parameters for this to work:

  • User Name: The username for the VM and for the Nextcloud instance.
  • Password: The password for the VM and for the Next cloud instance
  • Email: The email address used with Let’s Encrypt.
  • DNS Name: The DNS prefix Azure assigns to the public IP and VM. It’s used by Let’s Encrypt to register an SSL with the VM.

Once you deploy the resource, you can navigate to the hostname of the VM: https://yourhost.region.cloudaddp.azure.com

From there, you can log on to your Nextcloud instance and customize it to your heart’s content. Don’t forget the desktop and mobile apps!

nextcloud-azure's People

Contributors

theonemule avatar mmlufer avatar

nextcloud-azure's Issues

Error de implementación en Azure

{"code":"VMExtensionProvisioningError","message":"La VM informó de un error al procesar la extensión \"nextcloud-setup\" (editor \"Microsoft.Azure.Extensions\" y tipo \"CustomScript\"). Mensaje de error: \"Enable failed: failed to execute command: command terminated with exit status=5\n[stdout]\nGet:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]\nGet:2 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [781 kB]\nGet:3 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [143 kB]\nGet:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [16.7 kB]\nGet:5 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [36.5 kB]\nGet:6 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7060 B]\nGet:7 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [260 B]\nHit:8 http://archive.ubuntu.com/ubuntu jammy InRelease\nErr:8 http://archive.ubuntu.com/ubuntu jammy InRelease\n Splitting up /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_InRelease into data and signature failed\nGet:9 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]\nGet:10 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [109 kB]\nGet:11 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [970 kB]\nGet:12 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [222 kB]\nGet:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [15.6 kB]\nGet:14 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [838 kB]\nGet:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [135 kB]\nGet:16 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [536 B]\nGet:17 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [979 kB]\nGet:18 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [213 kB]\nGet:19 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [21.8 kB]\nGet:20 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [41.6 kB]\nGet:21 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [9768 B]\nGet:22 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [476 B]\nGet:23 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [41.7 kB]\nGet:24 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [10.5 kB]\nGet:25 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]\nGet:26 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]\nGet:27 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [24.3 kB]\nGet:28 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.4 kB]\nGet:29 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [640 B]\nGet:30 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]\nReading package lists...\nReading package lists...\nBuilding dependency tree...\nReading state information...\nCalculating upgrade...\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\nReading package lists...\nBuilding dependency tree...\nReading state information...\nPackage certbot is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\n\n<VirtualHost *:80>\nServerName nas.southcentralus.cloudapp.azure.com\nDocumentRoot /var/www/html/nextcloud\n\n<Directory /var/www/html/nextcloud/>\n Require all granted\n Options FollowSymlinks MultiViews\n AllowOverride All\n <IfModule mod_dav.c>\n Dav off\n </IfModule>\n</Directory>\n\nErrorLog /var/log/apache2/nas.southcentralus.cloudapp.azure.com.error_log\nCustomLog /var/log/apache2/nas.southcentralus.cloudapp.azure.com.access_log common\n</VirtualHost>\n\n[stderr]\n.. .......... .......... .......... 98% 150M 0s\n144950K .......... .......... .......... .......... .......... 98% 157M 0s\n145000K .......... .......... .......... .......... .......... 98% 71.1M 0s\n145050K .......... .......... .......... .......... .......... 98% 174M 0s\n145100K .......... .......... .......... .......... .......... 98% 144M 0s\n145150K .......... .......... .......... .......... .......... 98% 113M 0s\n145200K .......... .......... .......... .......... .......... 98% 76.7M 0s\n145250K .......... .......... .......... .......... .......... 98% 105M 0s\n145300K .......... .......... .......... .......... .......... 98% 78.3M 0s\n145350K .......... .......... .......... .......... .......... 98% 162M 0s\n145400K .......... .......... .......... .......... .......... 98% 167M 0s\n145450K .......... .......... .......... .......... .......... 98% 82.1M 0s\n145500K .......... .......... .......... .......... .......... 98% 143M 0s\n145550K .......... .......... .......... .......... .......... 99% 113M 0s\n145600K .......... .......... .......... .......... .......... 99% 101M 0s\n145650K .......... .......... .......... .......... .......... 99% 97.4M 0s\n145700K .......... .......... .......... .......... .......... 99% 95.8M 0s\n145750K .......... .......... .......... .......... .......... 99% 116M 0s\n145800K .......... .......... .......... .......... .......... 99% 99.0M 0s\n145850K .......... .......... .......... .......... .......... 99% 128M 0s\n145900K .......... .......... .......... .......... .......... 99% 123M 0s\n145950K .......... .......... .......... .......... .......... 99% 74.4M 0s\n146000K .......... .......... .......... .......... .......... 99% 72.9M 0s\n146050K .......... .......... .......... .......... .......... 99% 81.4M 0s\n146100K .......... .......... .......... .......... .......... 99% 109M 0s\n146150K .......... .......... .......... .......... .......... 99% 113M 0s\n146200K .......... .......... .......... .......... .......... 99% 83.3M 0s\n146250K .......... .......... .......... .......... .......... 99% 84.0M 0s\n146300K .......... .......... .......... .......... .......... 99% 63.2M 0s\n146350K .......... .......... .......... .......... .......... 99% 53.8M 0s\n146400K .......... .......... .......... .......... .......... 99% 27.8M 0s\n146450K .......... .......... .......... .......... .......... 99% 104M 0s\n146500K .......... .......... .......... .......... .......... 99% 135M 0s\n146550K .......... .......... .......... .......... .......... 99% 81.4M 0s\n146600K .......... .......... .......... .......... .......... 99% 91.1M 0s\n146650K .......... .......... .......... .......... .......... 99% 107M 0s\n146700K .......... .......... .......... .......... .......... 99% 94.4M 0s\n146750K .......... .......... .......... .......... .......... 99% 128M 0s\n146800K .......... .......... .......... .......... .......... 99% 102M 0s\n146850K .......... .......... .......... .......... .......... 99% 83.4M 0s\n146900K .......... .......... .......... .......... .......... 99% 74.1M 0s\n146950K .......... .......... .......... .......... .......... 99% 61.2M 0s\n147000K .......... .......... .......... .......... .......... 99% 86.0M 0s\n147050K .......... ... 100% 163M=7.5s\n\n2023-09-11 02:15:36 (19.2 MB/s) - ‘nextcloud-24.0.1.zip’ saved [150593304/150593304]\n\ninstall.sh: line 59: unzip: command not found\nchown: cannot access 'nextcloud': No such file or directory\ninstall.sh: line 61: cd: nextcloud: No such file or directory\ninstall.sh: line 64: php: command not found\nsed: can't read ./config/config.php: No such file or directory\nsed: can't read ./config/config.php: No such file or directory\nchown: cannot access 'nextcloud': No such file or directory\ntee: /etc/apache2/sites-available/nextcloud.conf: No such file or directory\ninstall.sh: line 92: a2ensite: command not found\ninstall.sh: line 93: a2enmod: command not found\ninstall.sh: line 96: certbot: command not found\nFailed to restart apache2.service: Unit apache2.service not found.\n\". Puede obtener más información sobre la solución de problemas en https://aka.ms/VMExtensionCSELinuxTroubleshoot. "}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.