[Oracle VPS] Create your own Cloud Server always free
Table of Contents
VPS Oracle - This article is part of a series.
Introduction #
This article is part of a series dedicated to hosting free services for life on a private server. In this one, I’ll show you how to create your own Cloud server.
What is the Cloud? #
We often hear people talk about this term without necessarily understanding what’s behind it. It’s actually quite simple!
The Cloud is a set of IT services accessible via the Internet.
Instead of using softwares and storage on your own computer, you use the servers of other companies who own these resources.
These services are provided by specialized companies such as :
- Amazon Web Services (AWS)
- Google Cloud
- Oracle Cloud Infrastructure (OCI)
- Microsoft Azure
- OVH
- …
For Google Cloud, for example:
Instead of installing Word, Excel, PowerPoint and storing all your files on your computer, you use Google’s servers, where you have a certain amount of reserved storage space and where all these softwares are already installed.
The different types of Cloud #
Although the principle remains the same, there are different types of Clouds.
Public Cloud vs. Private Cloud #
A public cloud is a service offered to several customers by a single provider. Customers share the provider’s resources. Although customers only see their own data, in reality each customer’s data is stored in the same place.
In contrast, the private cloud is a service that is not shared with any other organization. The private cloud user has the cloud to himself.
Hybrid cloud vs Multi-cloud #
The hybrid cloud can be defined as an environment made up of several interconnected clouds. It can be made up of several public or private clouds, or a mixture of the two. The public cloud can be used for certain tasks, and the private cloud for others.
Often confused with the hybrid cloud, the multi-cloud relies on different cloud services from different providers.
Benefits and disadvantages #
A public cloud is generally less expensive and easier to manage, as the provider takes care of software installation, configuration and updates…
On the other hand, it can raise security concerns, because if one of the supplier’s customers is hacked and the attackers gain full access to the server, they’ll be able to steal your data since it’s all in the same place!
A public cloud saves time and money, at the cost of security.
On the other hand, a private cloud is more secure because you’re the only user of your space, but it’s generally more expensive, and you’re responsible for installing, configuring and updating the software.
A private individual simply wishing to store a few vacation photos for posting on social networks will be more than happy with a public cloud, whereas a company with sensitive data will be more likely to opt for a private cloud.
But don’t think that private clouds are just for business!
In fact, if you want to store passwords, work documents on personal projects, share private documents only with certain people, etc., then the private cloud may be of interest to you.
And that’s just what we’re going to do by creating our own private server!
Solution chosen: NextCloud #
Nextcloud is an online file storage and sharing solution that you can install on your own server.
Pros #
- It’s open-source, meaning that its source code is publicly available. There is continuous improvement of the software, as anyone can contribute to the code.
- It has a large community, which guarantees regular updates and extensive documentation.
- It has numerous applications that let you turn your cloud into a password manager (like BitWarden), a music server (like Spotify), a videoconferencing server (like Teams), and many more.
- It’s multi-platform, so it’s easy to use on Windows, MacOS, Linux, Android or iOS.
- It’s free for life!
Cons #
- Requires you to install and configure the application yourself.
- 200 GB maximum free storage (limited by OCI’s “Always Free” offer)
Well, now that you know everything, let’s get started!
Cloud server creation #
→ Read the introduction of this serie
Creating an instance #
To begin with, we’ll need to create an instance on OCI.
Choose a server name, leave the default compartment and change the image:
Select the image Ubuntu 20.04 :
Choose the resources to allocate :
You can change the VNIC or leave the default one, then download the SSH private key:
Create a boot volume of the desired size, here I take the maximum so 200 GB :
You don’t need to change anything else, you can create the instance:
Once the instance has been created, make a note of your VM’s IP address:
Connect to your VM via SSH:
ssh ubuntu@[IP_of_your_VM] -i [ssh_key]
Then perform system updates:
sudo apt update -y && sudo apt upgrade -y
Your instance is now ready, and we’re ready to install NextCloud.
Installing NextCloud #
Install the nextcloud package via snap
:
sudo snap install nextcloud
Creating an administrator account #
Create a new administrator account with the following command. This account will be used to set up NextCloud:
sudo nextcloud.manual-install [account] [password]
The following message indicates that Nextcloud has been configured correctly:
Nextcloud was successfully installed
Setting the trusted domain #
During command-line installation, NextCloud limits the hostnames to which the instance will respond.
By default, NextCloud only allows localhost
as trusted domain, but we won’t be able to access this domain from the outside, so we need to add the server’s IP address as trusted domain.
You can view the current settings by querying the value of the trusted_domains
array:
sudo nextcloud.occ config:system:get trusted_domains
Currently, only localhost
is present as a value in the table. We can add our server’s IP address by typing :
sudo nextcloud.occ config:system:set trusted_domains 1 --value=[IP_of_your_VM]
If we query the trusted domains again, we see that we do indeed have the IP address of our VM :
sudo nextcloud.occ config:system:get trusted_domains
config:system:set
command, simply increment the number → example for a second domain: sudo nextcloud.occ config:system:set trusted_domains 2 --value=second_domain.com
NextCloud configuration #
Our NextCloud server is currently set up to trust a domain name or IP address. However, no encryption process has been configured.
You know the little padlock that indicates you’re in HTTPS.
To do this, we’re going to set up an SSL/TLS certificate.
SSL/TLS certificate with Let’s Encrypt #
If you have a domain name associated with your NextCloud server, the best option for securing your web interface is to obtain a Let’s Encrypt certificate.
Request a Let’s Encrypt certificate by typing :
sudo nextcloud.enable-https lets-encrypt
You will first be asked whether your server meets the requirements for requesting a certificate from the Let’s Encrypt service:
In order for Let's Encrypt to verify that you actually own the
domain(s) for which you're requesting a certificate, there are a
number of requirements of which you need to be aware:
1. In order to register with the Let's Encrypt ACME server, you must
agree to the currently-in-effect Subscriber Agreement located
here:
https://letsencrypt.org/repository/
By continuing to use this tool you agree to these terms. Please
cancel now if otherwise.
2. You must have the domain name(s) for which you want certificates
pointing at the external IP address of this machine.
3. Both ports 80 and 443 on the external IP address of this machine
must point to this machine (e.g. port forwarding might need to be
setup on your router).
Have you met these requirements? (y/n)
→ Type y
to continue.
Next, you will be asked to provide an e-mail address to be used for recovery operations:
Please enter an email address (for urgent notices or key recovery):
→ Enter your e-mail address and press Enter
to continue.
Finally, enter the domain name associated with your NextCloud server:
Please enter your domain name(s) (space-separated): example.com
Your Let’s Encrypt certificate will be requested and, if all goes well, the internal Apache instance will be restarted to immediately implement SSL :
Attempting to obtain certificates... done
Restarting apache... done
You can now proceed to the NextCloud firewall configuration step.
Self-signed SSL/TLS certificate #
If you have no domain name, you can still set up encryption on your Nextcloud server by generating a self-signed SSL/TLS certificate. This certificate will enable access to the web interface via an encrypted connection.
To generate a self-signed certificate and use it on your Nextcloud server, type:
sudo nextcloud.enable-https self-signed
The output above indicates that NextCloud has generated and activated a self-signed certificate.
You can now proceed to the NextCloud firewall configuration step.
Firewall configuration #
The basic Ubuntu OCI image is set up with iptables
, blocking access to ports 80 and 443 (ports used by HTTP and HTTPS protocols).
We’re going to replace this setting with the ufw
firewall and open these ports.
First, run the following commands:
sudo iptables -P INPUT ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -F
Then authorize the ufw
firewall with the command:
sudo ufw enable
You can check whether ufw
is active with the command:
sudo ufw status
Finally, enable the SSH protocol as well as ports 80 and 443:
sudo ufw allow ssh
sudo ufw allow 443/tcp
sudo ufw allow 80/tcp
You can check the firewall rules with the command:
sudo ufw status numbered
All you have to do is open these ports on the OCI VNIC:
→ Your Nexcloud server is ready to use!
Using NextCloud #
Go to the url https://[IP_of_your_VM]
and log in with the administrator account you created earlier:
Check storage space #
Go to “Administration settings > System” to check the available storage space on your server:
Create users #
Go to the “Users” tab:
Then click on “New account” and fill in the information for the new account:
This user can now connect and store files on your NextCloud server:
You can share access with your friends or family, while fine-tuning the settings for each person. For example, you can allow only photos or videos to be stored, or specify the amount of storage space reserved for each person.
Access your server from your smartphone #
You can access your NextCloud server from any browser via the url https://[IP_of_your_VM]
or you can install the NextCloud mobile app on your smartphone.
All you need to do is enter your server’s URL:
Then log in to access all your files:
Applications #
You can also install applications from the “Applications” tab:
NextCloud has many community-written applications, here are just a few examples:
Audio Player
→ for storing and playing music (like Spotify)Only Office
→ to edit word, excel, powerpoint files simultaneously (like Google Drive)Passwords
→ to store and manage your passwords (like BitWarden)Talk
→ to make audio and video calls (like Teams)Calendar
→ manage your calendars (like Google Calendar or Outlook)Notes
→ to manage your online notes with markdown language (like Notion)
Conclusion #
In this article, I’ve shown you how to create your own free Cloud server for life with the NextCloud solution, using Oracle Cloud Infrastructure’s “Always Free” offering.
The aim was to provide you with a practical, free solution while familiarizing you with the field of cloud and IT security.
After reading this article, you’ll now know :
- What a Cloud is
- What the different types of Cloud are
- How to create your own free Cloud for life
I hope you’ve enjoyed reading the article, and if you have, please feel free to like it and share it with any friends or colleagues who might be interested!