Create a Private Cloud (Email, File Storage, Website and Password Manager)
These days people are becoming more and more reliant on online services. The technology that was created to allow us to communicate with each other and share memories has, in many ways, made us more distant and less able to modify/change the tools we use. It also comes at the price of giving up our data to large corporations to the point where they often know more about us than we know about ourselves.
Instead of using Gmail, dropbox, or any of the other supposed free services, you can host free open-source services that are privacy-respecting and developed by everyday developers like you or me. For all the services I’ve set up, I created an automation script so you won’t have to do much. In this article, I’m going to show you how you can set up:
An Email server with Aliases and forwarding
File Storage with a built in calendar tool
Your own personal website or portfolio
A password manager to keep track of your passwords
The email server itself uses postfix/dovecot for sending and receiving mail. Spamassasin is used to get rid of spam, and OpenDKIM is used so we can send emails to Gmail/yahoo. The data is stored in mariaDB in the backend. I set up 3 basic aliases called social, purchasing, and professional. Aliases are kind of like temporary/fake addresses. When I sign up to buy something, I give firstname.lastname@example.org as an email address, and all the mail is forwarded to my primary address. If it ever gets too spammy/cluttered, I can simply delete the alias and start again.
The file storage service I use is called Nextcloud. It’s very similar to google drive and has a nice clean PHP frontend. There’s also an option to add a calendar if you want a service similar to google calendar.
I used a password manager service called keypass. It’s incredibly simple to use as it is a DB file that holds all your passwords and can be stored anywhere. It literally takes 5 minutes to set up. I suggest you check out my video above where I explain it a bit further.
Things You’ll Need
Before this article you’ll need to buy a virtual private server/ cloud instance (or set up a server of your own at home if you have decent bandwidth). If you’re planning on adding many other services I’d recommend a VPS but with the services in this article I don’t think I’ve used much more than 0.7 G of RAM and 10GB of storage. So far I’ve only tested my scripts on Ubuntu so make sure your serve is running Ubuntu 18 or 20. Note: Don’t use an Amazon EC2 instance or the Microsoft equivalent they tend to block the ports needed for Email servers. Also we’re trying to not rely on giant tech companies remember? ;) You’ll also need a domain name and you’ll need to set the domain/subdomains to the IP address of your server. For the email you’ll need to also create an MX record. There are plenty of tutorials on how to do this out there. My records look something like this:
#My main portfolio @ IN A <IP ADDRESS> www IN CNAME @ #My Nextcloud/File Storage instance nextcloud IN A <IP ADDRESS> #Mail MX record IN MX 10 <My domain>.
Setting Up The Services
I could go through the process of giving you step-by-step tasks for each service but I’ve gone through the process of creating automation scripts that will do this for you. You can check out the scripts in my github lined here.
Simply run the following command on your serve to start off:
git clone https://github.com/CoogyEoin/SaorTech-cloud-services.git
There are 3 main scripts for email, nextcloud and your personal website. When running these commands certain flags are used to specify your domain, password, the email to forward to/used to register certificates and other things. Run the following commands as Sudo on your server but make sure you replace the values with your own. The email (-e) flag is just an email address it will forward mail to.
./install_mail_server.sh -e email@example.com -d mydomain.com -p asecurepassword -u mycurrentuser -f mail.mydomain.com
The email (-e) flag is just used to register an SSL certificate
./install_nextcloud.sh -e firstname.lastname@example.org -d nextcloud.mydomain.com -p asecurepassword
Use whatever domain or subdomain you want/setup. I wanted my portfolio to just be the base domain name
./setup_website -d mydomain.com
And that’s it. When you first visit your nextcloud instance remember to set the username and password to whatever you want your admin account to be, the directory to /nextcloud-data , the user to nextcloud and the password with whatever you used as the flag when running the command.
The portfolio itself is…shall we say barren for the moment. Now’s your chance to brush up on your html/css skills. The directory containing the html is at /var/www/<mydomain.com> . The basic template that will appear at your domain when searched is shown below:
If you have any issues with these scripts you can check out my video above where I explain them a bit further. If there is any issues with the scripts please let me know either here or on Github.
Stay happy and stay private.