NextCloud Automated Installation
-
There has been much consternation around NextCloud being difficult to install, and scary for newcomers, especially as it is only available on Linux. Not only can it be difficult to install, but even just choosing which version of Linux can be a stumbling block if someone is not used to the decision process here. All is solved here with an enterprise grade, fully automated installation.
Step One: Install Fedora Linux 27 Server
That's it. Download the ISO from Fedora and do the most basic possible installation. This tool is designed to work with both Server and Minimal installation methods, but is primarily tested against Server. During installation simply be sure to set up networking during the installation. Once you are done installation, log in as root.
Step Two: Run the installation command...
source <(curl -s https://gitlab.com/scottalanmiller/nextcloud_fedora_installer/raw/master/nextcloud_fedora.sh)
When this command runs it will ask a few basic user and password questions. And that's it, just sit back and wait.
Step Three: Log in and use Nextcloud!
https://youripaddress/nextcloud/
That's really it. Install the OS, run the command, and done. The system will automatically install all needed packages, configure the database, apply passwords, install and properly configure caches, even run through the normal installation you would do on the web site. Everything, it's done. Your new system is updated, secured, configured, and ready to use. Log in with the username and password that you provided when you started the script.
Current Fedora Version Tested: Fedora 27
Current NextCloud Version Tested: NextCloud 13.0
Notes:
This installation is meant to be a production ready server and, as such, is meant to be headless. There is no local GUI installed and no need to do any local configuration. The web interface is fully configured and secured before use to be accessed by another web browser on your network. Once installed, only port 443 (HTTPS) is open to the network for NextCloud.
Because of the install style used here, this installer will work perfectly well anywhere from installing on a physical box, a VM running on any hypervisor, or installed to any cloud environment that supports Fedora Linux. This install script is highly flexible and portable.
In the current version, the system sets up /data directory as the location for data files. If you are an advanced user and will be creating a discrete data filesystem, you will need to create /data and mount that filesystem there prior to running the script. I do this myself and recommend XFS on LVM2; NextCloud recommends BtrFS.
This install only does MariaDB which is the best option for nearly all deployments. If you want to use SQLite or PostgreSQL, let me know, the script will need to be expanded for those options.
SELinux is not disabled here. All the extra security that it provides is included with full configuration done as part of the install.
SSL Certifications and Backups are not configured in this script, please consider those things once this has been completed.
The purpose of this installer is to make it as simple as possible for anyone to get up and running with a well crafted, by the book, enterprise grade NextCloud install. No corners cut, ready for solid production use. It is meant to make NextCloud accessible to everyone. If you have advanced or very specific needs for your NextCloud install, you should consider a manual install, but this script should serve as a guide and starting point to that process.
Special thanks to @JaredBusch for his NextCloud on Fedora guide as a starting point for this script.
-
Placeholder for Vultr automation guide.
The Vultr cloud is one of the better options for a hosted Nextcloud instance because of their low cost (and insanely popular) SATA based Storage Instances. If you can get one, they make for an extremely effective Nextcloud server, although they will be a little slow due to a lack of CPU and RAM resources, but they work just fine.
Vultr, as with most cloud computing providers, also has great options for more traditional instances that can add block storage additionally to the base instance - this is a very popular mode for larger or more performant Nextcloud installs. In either case, Vultr makes it super simple to do a Nextcloud install with essentially no interaction from you.
Now of course, we could just log in to our cloud instance as if it were any other server and run our script as I showed above. But with Vultr, we can make it so that no login to the server is ever needed, which is pretty cool.
Step One: On Vultr under "Deploy New Instance" go down to #5 "Startup Script" and select "Manage". Then select "Add Startup Script". Enter a name like "Nextcloud on Fedora Installer". Leave the type as "boot". Then replace the body of the script with the contents of this script, just copy and paste over what is there: https://gitlab.com/scottalanmiller/nextcloud_fedora_installer/raw/master/nextcloud_fedora.sh
Don't save that file quite yet, though.
Step Two: We need to remove the part of the file where it prompts for usernames and passwords and instead just set them manually.
So remove this section:
echo "Installing NextCloud 13 for Fedora 27 Server or Minimal" echo "If you have not made a DNS entry for the system," echo "it is recommended that you do so now." echo "" echo "Enter the database password for NextCloud: " read ncpass echo "Enter the root MariaDB user password: " read rootpass echo "Enter the name of your web admin user account (ex. admin)" read adminuser echo "Enter the initial password for admin" read adminpass
And replace it with this...
ncpass="mysecretdbpassword" rootpass="mysecretdbrootuserpassword" adminuser="admin" adminpass="myadminuserpasswordforthewebpage"
Step Three: Create your Vultr instance, either VC2 or a Storage instance. Select any Vultr datacenter location. Select Fedora 27 as your server type. Chose a minimum of 1GB of RAM, more is better. Remember to select your new "NextCloud on Fedora Installer". At step six add any keys that you have that you want. And add your system name at the bottom. Now you can "Deploy Now".
Step Four: Wait until the system returns an IP address for you. This will take a minute. You should get an email with this information as well as it populating on the Vultr console. Now, go get some coffee and a donut, you've got a little while to wait until the installation completes. Maybe take this time to add that new IP address to your DNS system so that you can use a fancy URL immediately once the install is done.
When it finally completes, just go to https://myfancyurl/nextcloud/ to use your new NextCloud install!
With this pre-stored script method, you can create a brand new NextCloud system, fully configured, in just minutes at any Vultr datacenter. Step One is only done the first time. After that, it's just steps two and three for as many NextCloud servers as you want to have. Vultr (and this script) really make Nextcloud that easy.
-
@scottalanmiller Thank you sir. I know what i will be doing on Monday.
-
@scottalanmiller It took me 40 minutes from start to finish. I even added a 200GB lvm2. All done via cockpit. Nice job!
-
Just added the Vultr guide, as well. One little modification and you don't even need to log in to run the script!
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller It took me 40 minutes from start to finish. I even added a 200GB lvm2. All done via cockpit. Nice job!
Awesome, thanks for testing it out. That's amazing.
I just did the Vultr based build using it as well, worked perfectly and only took maybe 15 minutes, I'd guess. But Vultr has updates already applied and you don't need to log in or do anything, so it is that much faster.
-
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller It took me 40 minutes from start to finish. I even added a 200GB lvm2. All done via cockpit. Nice job!
Awesome, thanks for testing it out. That's amazing.
I just did the Vultr based build using it as well, worked perfectly and only took maybe 15 minutes, I'd guess. But Vultr has updates already applied and you don't need to log in or do anything, so it is that much faster.
Now I just need to make the switch from an ubuntu instance to fedora at work and we will be all set.
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller It took me 40 minutes from start to finish. I even added a 200GB lvm2. All done via cockpit. Nice job!
Awesome, thanks for testing it out. That's amazing.
I just did the Vultr based build using it as well, worked perfectly and only took maybe 15 minutes, I'd guess. But Vultr has updates already applied and you don't need to log in or do anything, so it is that much faster.
Now I just need to make the switch from an ubuntu instance to fedora at work and we will be all set.
NextCloud works fine on Ubuntu, too. But I certainly prefer it on Fedora. Especially with what a good job Fedora does with things like keeping PHP up to date.
-
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller It took me 40 minutes from start to finish. I even added a 200GB lvm2. All done via cockpit. Nice job!
Awesome, thanks for testing it out. That's amazing.
I just did the Vultr based build using it as well, worked perfectly and only took maybe 15 minutes, I'd guess. But Vultr has updates already applied and you don't need to log in or do anything, so it is that much faster.
Now I just need to make the switch from an ubuntu instance to fedora at work and we will be all set.
NextCloud works fine on Ubuntu, too. But I certainly prefer it on Fedora. Especially with what a good job Fedora does with things like keeping PHP up to date.
I only used it because at the time it was the only guide that worked on the first shot.
-
For SSL: how do we add LE to the mix or did I miss that part?
-
@scottalanmiller any ideas how to change the maximum upload size from the web? Web interface says "missing permissions to edit from here"
-
@fateknollogee said in NextCloud Automated Installation:
For SSL: how do we add LE to the mix or did I miss that part?
I was wondering that myself. I read the script before I ran it and I didn't see anything about the configuration commands.
-
@mattbagan said in NextCloud Automated Installation:
@fateknollogee said in NextCloud Automated Installation:
For SSL: how do we add LE to the mix or did I miss that part?
I was wondering that myself. I read the script before I ran it and I didn't see anything about the configuration commands.
Right now that’s done after.
-
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@fateknollogee said in NextCloud Automated Installation:
For SSL: how do we add LE to the mix or did I miss that part?
I was wondering that myself. I read the script before I ran it and I didn't see anything about the configuration commands.
Right now that’s done after.
Interesting, I am presented a certificate that I did not setup.
-
@fateknollogee said in NextCloud Automated Installation:
For SSL: how do we add LE to the mix or did I miss that part?
The pieces are there. It’s a stock Apache vhost at that point.
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@fateknollogee said in NextCloud Automated Installation:
For SSL: how do we add LE to the mix or did I miss that part?
I was wondering that myself. I read the script before I ran it and I didn't see anything about the configuration commands.
Right now that’s done after.
Interesting, I am presented a certificate that I did not setup.
Sure. But not one from LE. It’s the generic self signed one.
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller any ideas how to change the maximum upload size from the web? Web interface says "missing permissions to edit from here"
Send me the error. I’ll get it scripted.
-
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller any ideas how to change the maximum upload size from the web? Web interface says "missing permissions to edit from here"
Send me the error. I’ll get it scripted.
It's not some much of an error its a greyed out box in settings, under the file handling.
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller any ideas how to change the maximum upload size from the web? Web interface says "missing permissions to edit from here"
Send me the error. I’ll get it scripted.
It's not some much of an error its a greyed out box in settings, under the file handling.
If I remember correctly it has something to do with SELinux preventing you from changing that. It also can affect upgrading Nextcloud via web updater.
-
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller said in NextCloud Automated Installation:
@mattbagan said in NextCloud Automated Installation:
@scottalanmiller any ideas how to change the maximum upload size from the web? Web interface says "missing permissions to edit from here"
Send me the error. I’ll get it scripted.
It's not some much of an error its a greyed out box in settings, under the file handling.
Okay