![Two women enjoying a casual conversation outdoors, sharing a laptop and smartphone.](https://images.pexels.com/photos/5384439/pexels-photo-5384439.jpeg?auto=compress&cs=tinysrgb&w=1920)
Nextcloud is a fantastic self-hosted cloud storage solution that allows you to access and share your files from anywhere. To get started, you'll need to install Nextcloud on a server, which is where DigitalOcean comes in.
DigitalOcean is a cloud platform that makes it easy to set up and deploy servers in the cloud. You can create a new Droplet, which is DigitalOcean's term for a virtual server, in just a few clicks.
To install Nextcloud on DigitalOcean, you'll need to create a new Droplet with at least 2GB of RAM. This will give you enough resources to run Nextcloud smoothly.
You can choose from a variety of pre-configured images, including Ubuntu and CentOS, to install Nextcloud on your Droplet.
Intriguing read: How to Create a Onedrive
Installation
To install Nextcloud on DigitalOcean, start by running the install script as a root user. This script will prompt you to set up a user soon.
Use wget to retrieve the package located in the copied GitHub URL and then run the shell script using the bash command. Don't worry if some parts look different, as the software has been updated since the video was made.
You can copy and paste important sections into a text file for later reference, or even save your installation notes as a blog post. This will come in handy when you're trying to troubleshoot any issues that may arise.
Readers also liked: Install Nextcloud
Installation Note
![Men and Women Sitting in front of Computers and a Large Screen](https://images.pexels.com/photos/19317897/pexels-photo-19317897.jpeg?auto=compress&cs=tinysrgb&w=1920)
The first time installing an SSL certificate, the VM may not be able to connect, and it will try two more times before providing a TXT record to add to Cloudflare.
You'll need to wait until the TXT record has propagated, which you can check using whatsmydns.net. I personally used this method to verify the propagation of the record.
Refreshing your router's firewall while waiting for the TXT record to propagate can be a bit tricky, as it's hard to determine what solved the issue – the router refresh or the new TXT record.
Either way, the SSL certificate should install successfully after the TXT record has propagated. I'll update this section when I install another VM.
Consider reading: Nextcloud Aio Vm
Droplet and Spaces Setup
To set up your Droplet and Spaces, you'll want to start by creating a standard droplet. This will serve as the foundation for your file server. You'll need to choose a droplet size that meets the minimum requirements.
For this example, let's consider the basic 1G RAM, 25 GB SSD disk droplet that runs $5/month from DO's nyc3 region. This is a great option for a small-scale setup.
You'll also want to enable Block Storage, which will give you access to additional storage. For this, you'll need to choose at least 50GB and manually format and mount it.
Next, choose a data center that is close to you or your users. This will help ensure faster file transfer speeds.
Add any SSH keys you'll be using to access your Droplet.
Finally, choose a unique name that describes the use of your file server.
Here's a quick rundown of the steps:
- Create a standard droplet
- Choose droplet size (See minimum requirements)
- Enable Block Storage – Choose at least 50gb, & Manually Format And Mount
- Choose a data center that is close to you (or your users)
- Add any SSH keys you will be using
- Choose a unique name that describes the use of your file server
Once you've set up your Droplet, you can configure your spaces instance. This will give you additional storage space. In this example, I picked up a spaces instance within the same region, which gave me 250GB at an additional $5/month.
Setup and Configuration
To set up and configure your DigitalOcean Nextcloud server, start by creating a standard droplet with a suitable size and data center location. Choose a droplet size that meets the minimum requirements and select a data center close to you or your users.
To enable block storage, choose at least 50GB and manually format and mount it. Add any SSH keys you'll be using and give your file server a unique name that describes its use.
Here are the steps to configure your droplet:
- Create a standard droplet
- Choose droplet size (See minimum requirements)
- Enable Block Storage – Choose at least 50gb, & Manually Format And Mount
- Choose a data center that is close to you (or your users)
- Add any SSH keys you will be using
- Choose a unique name that describes the use of your file server
Once you've set up your droplet, you can proceed with the Nextcloud installation.
Configure Droplet
To configure a droplet, start by creating a standard droplet and choosing a droplet size that meets the minimum requirements.
Choose a data center that is close to you or your users to ensure optimal performance.
Enable Block Storage, selecting at least 50GB, and manually format and mount it.
Add any SSH keys you will be using to the droplet.
Choose a unique name that describes the use of your file server.
Here's a summary of the steps:
- Create a standard droplet
- Choose droplet size (See minimum requirements)
- Enable Block Storage – Choose at least 50gb, & Manually Format And Mount
- Choose a data center that is close to you (or your users)
- Add any SSH keys you will be using
- Choose a unique name that describes the use of your file server
Setting Up DNS
You can set up the DNS records in the meantime while the install script is running. This will save you time later on.
Cloudflare is a great choice for setting up DNS, as it offers fast DNS record updates and a Content Delivery Network (CDN). They also sell domain names at wholesale price.
Daniel Hensson sets up his DNS in Cloudflare, which is a great choice because of its speed and features.
To set up an A Record, you'll need to add a record named after the service you're setting up, such as "cloud" at the IP Address of your DigitalOcean Droplet. Set Automatic TTL and select the cloud icon to set the Hostname to not pass through Cloudflare (Grey Cloud).
Here's a list of A Records you might need to set up:
- Cloud
- Office
- Collabora
After setting up your A Records, check that they have propagated correctly using whatsmydns.net.
Setup and Configuration
The installation script will reboot your server, so be prepared to log back in via SSH using the command ssh root@your ip address.
After the reboot, you'll need to run the Startup Script as the user ncadmin, not the default root user.
To do this, you'll need to run the command sudo -u ncadmin /var/scripts/nextcloud-startup-script.sh, which gives the script super user privileges to run as the user ncadmin.
The -u flag is used to run the script as a different user, in this case ncadmin, and it's essential to understand how flags work, so be sure to check out the Sudo Manual for more information.
You'll know you're on the right track if you're running the script as the correct user, and the script will take care of the rest of the setup and configuration for you.
Remember, the script will only run correctly if you're logged in as the correct user, so double-check your user before running the script.
Upload Zip File
To upload a zip file, head to the File Manager on your panel and access the public_html folder.
Before uploading the zip file, delete the existing index.html file to avoid getting forbidden errors on your site.
Now, locate the Nextcloud zip file and upload it to the public_html folder.
Make sure to upload the correct file, as uploading the wrong one can cause problems with your site's functionality.
For your interest: Dropbox Host Site
Introducing Others
Introducing others to Nextcloud can be a great way to share the benefits of private file sharing with others.
You can set up an account for someone on your Nextcloud server with some collaborative tools pre-installed, allowing them to get a feel for the Nextcloud user experience without having to learn how to set up a server first.
This can be especially helpful for individuals who have valid and legal reasons for looking into private file sharing, such as members of a politically motivated group.
Consider reading: Nextcloud Migrate to New Server
Step 8: Increase Memory Limit and Remove Posix_Getuid
![Two diverse schoolgirls attentively sharing a laptop outdoors, fostering learning and friendship.](https://images.pexels.com/photos/5896661/pexels-photo-5896661.jpeg?auto=compress&cs=tinysrgb&w=1920)
To increase the memory limit for Nextcloud, you'll need to allocate at least 512 MB of memory for the PHP script on your server. This will ensure Nextcloud runs smoothly.
Next, navigate to the PHP Settings and make the necessary adjustment. Change the memory_limit field to the recommended amount.
You'll also need to remove the posix_getuid function from the Disabled Functions list. This will allow the function to work as intended.
Broaden your view: Google Storage Usage
Download Latest Release
You can also access the zip file under the Community Projects section on the Nextcloud installation page.
The zip file is available for download, and you can download it by following the link provided.
On a similar theme: Google Drive Direct Download Link
Database and Storage
DigitalOcean's Nextcloud solution offers scalable storage options, with the ability to start with 1GB of storage and scale up to 1000GB or more as needed.
Nextcloud's built-in redundancy ensures that your data is always available, even in the event of a hardware failure.
You can access your files from anywhere, at any time, using Nextcloud's web interface or mobile app.
DigitalOcean's Nextcloud solution integrates seamlessly with other DigitalOcean services, making it easy to manage your storage and other resources in one place.
Nextcloud's user-friendly interface makes it easy to share files and folders with others, while maintaining control over access and permissions.
Nextcloud's encryption features ensure that your data is protected from unauthorized access, even if your storage is compromised.
Broaden your view: Host Next Js on Digitalocean
Security and Maintenance
To set up a secure Nextcloud server, start by creating an administrator username and password after installation.
You'll also need to make your Nextcloud server reachable from outside your home by adding trusted domains, opening ports on your router, and setting up firewall rules.
Securing the web interface with SSL is also essential to protect your data.
A different take: Nextcloud Server
Backups
Having a reliable backup method is crucial, especially when working with data-intensive systems like Nextcloud.
A standard install of Nextcloud uses commands like occ and mysqldump, but a snap install requires different command names, such as nextcloud.occ.
A fresh viewpoint: Nextcloud Occ Commands
The author of the script found this out by checking the README file in the /snap/bin path, which is where the snap commands are located.
Snap allows for multiple versions of Nextcloud, so you have options when a new version is released, like deploying a new snap alongside the old one or provisioning a new droplet.
To manage Nextcloud and its included mysql instance, you can use the nextcloud.occ and nextcloud.mysqlclient commands.
The author modified a script to allow for timestamped copies of the mysql database dump, which can be run in cron and stored in a cloud storage service like S3.
You can easily recover your database and file storage using the nextcloud.occ and nextcloud.mysqlclient commands, along with s3cmd.
Suggestion: Nextcloud Snap
Setup and Maintenance
To get started with Nextcloud, you can visit the Github page or snapcraft.io/nextcloud. Once downloaded and installed, you'll be asked to create an administrator username and password.
You can do most things locally via your browser, using the local IP address of the device you have installed Nextcloud snap onto. After that, there might be several more required actions, especially if you want to make your Nextcloud server reachable from outside your home.
You may need to add trusted domains, open ports on your router, set up firewall rules, and secure the web interface with SSL. If you own a domain name, you can link your public-facing Nextcloud server to it, making it easier to share with friends and family.
Setting up a large external drive for storage requires extra steps, but it's worth the effort. If you're new to Nextcloud, consider starting with a local server in your home, which is much easier to achieve and still very useful.
You can begin with a basic 1G RAM, 25 GB SSD disk droplet that runs $5/month from DO's nyc3 region, and then add a spaces instance for extra storage. This will give you 250G at an additional $5/month.
Explore further: Google Drive Add on Chrome Desktop
Frequently Asked Questions
Is Nextcloud unlimited storage?
Nextcloud storage is technically unlimited, but actual storage capacity may be limited by your server's resources and setup
Is my Nextcloud safe?
For Nextcloud to be safe, always use an encrypted HTTPS connection to protect against data interception and unauthorized access. Using HTTPS is a best practice to ensure your server and user data remain secure.
Sources
- https://yadafaber.com/nextcloud-digitalocean/
- https://www.scottharney.com/digitalocean-and-nextcloud/
- https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-20-04
- https://theprivacydad.com/my-family-nextcloud-server/
- https://serveravatar.com/how-to-install-and-setup-nextcloud/
Featured Images: pexels.com