In the video below, I am demonstrating how you can easily setup your own LAMP-5 home web server home cloud, in 30 minutes. Basically, it requires setting up a Ubuntu Server, on for instance a VirtualBox, for then to to download a simple script, which does the heavy lifting for you.
If you don’t wish to use VirtualBox, feel free to find an old laptop, and convert it into a dedicated Ubuntu Server, which is what I have done. In fact, this is probably both safer, more secure, and less hassle – Since you can just simply plugin your old laptop into its power supply, and leave it be, for such to have a dedicated home web server, constantly accessible from anywhere you are in this world. Besides, at least on my Mac, the networking drivers for VirtualBox doesn’t seem to be perfectly stable for some reasons.
Since a Linux Ubuntu Server installation, consumes very small amounts of resources, this means that your “laptop server” could probably run for years, without any major troubles happening. But please, consider making sure you take backups of it, every now and then! But first, what the blip is a LAMP-5 home web server, and home cloud …?
Well, check out this video for a simple explanation …
In the video below, I am demonstrating how to install Sephia Five afterwards, which is a military grade cryptographically secured webmail client, allowing you to read your emails, on any device you’re on, from anywhere you are in this world, through your LAMP-5 setup. Notice, LAMP-5 means; “Linux, Apache, MySQL+Mono and Phosphorus Five”. But I guarantee you, it’s at least 5 times as cool as pure LAMP … 😉
You can find the recipe for what to do below the video. However, please watch the video first, since there’s a lot of nice tips and tricks in it for you.
First download and install Virtual Box, if you intend to use your existing laptop, and don’t have a spare one laying around, which you can turn into a dedicated server. If you have a dedicated laptop, you’ll have to create a bootable USB stick or something, which you can boot your old laptop into. Exactly how to do this, is beyond the scope of this little tutorial, but Google is your friend here … 😉
Then download and install Ubuntu Server.
Install your Ubuntu Server, and make sure you follow its default installation. Don’t install Apache or MySQL, since we’ll do that in an automated script later. One thing, which might be wise of you to do though, is to make sure you set it up, such that it automatically downloads and install updates. After a couple of years, typically your server might contain security holes, which you could automatically avoid, by having it automatically install any updates, without you having to ever again even look at it! Servers are things we tend to take for granted, and which simply works, and hence we don’t think consciously about updating them, as new security updates are released. Making sure it automatically updates itself, is probably a wise thing …
Below you can find the complete recipe for how to setup your LAMP-5 server, assuming you’ve got your Ubuntu Server up and running.
chmod +x install.sh
Basically, that’s it! After having executed the above 3 lines of Terminal commands on your Linux Server, everything should work perfectly. Notice, execute one line at the time! The above script installed the following automatically for you.
- MySQL (without networking)
- mod_mono (and made some changes, to allow for most URLs to be routed into Mono directly)
- GnuPG (to store your PGP key pairs)
- Phosphorus Five (with its Bazar, and everything)
When you have executed the above, your LAMP-5 stack is basically up running, and you can setup P5 by visiting your server’s IP address, in your browser. Hint, don’t access it externally just yet. Use your local LAN IP address to set it up first. Also, please keep on reading, since there are some majorly important additional security steps you should follow, before you go berserk with your own personal home web server and cloud …
One crucial point, which I didn’t talk about in the video, is the fact that you probably don’t have a static IP address with your internet service provider. For the most parts, this haven’t historically been a big problem, since for some reasons, most ISPs tends to allow you to lease your IP address for an extensive amount of time, before they release it, and give you a new one. However, if this is a problem, you might want to talk to your ISP, and request a static IP from them. For my ISP, this would cost me apprx. 3-4 dollars extra per month.
If your server is slow, you might also want to upgrade your outbound bandwidth. This is not the same as being advertised by your ISP as “bandwidth”, since they tend to market only inward bandwidth. For instance, my line is a “50 megabit line”, however my upload speed is only 5 megabit. This makes it slow while downloading huge files and such from the outside. But for simply reading my emails and such, it’s more than adequate.
Also, **DO NOT ACCESS YOUR WEB SERVER REMOTELY FROM YOUR EXTERNAL IP** before you have setup an SSL certificate. The reason is that when you login to P5, the password will be sent in clear text, unencrypted. To setup an SSL certificate on your web server, is ridiculously easy though. Simply check out the tutorial over at this link. Or run the following script in your terminal.
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
sudo certbot renew –dry-run
The above will do everything automatically for you, and setup your server with an SSL certificate, encrypting all traffic between clients and your web server. It will even create an automated job, automatically renewing your certificate, every 90 day!
When you have done so, you’d probably want to visit your router, which can be done at 192.168.0.1, from where you can setup a port forwarding rule for your HTTP port (80), and its associated HTTPS port (443).
If you’re denied access to your router, you should find its brand and model number somewhere, typically on the router’s main landing page. Simply Google its brand and number, add “password” to your search query, and you’ll probably find its default username and password combination, somewhere out there. Typically its something like “admin/admin”. But this depends upon your router vendor.
Make sure you open up both port 80 and port 443, and that you forward all requests on these two ports to your Ubuntu Server’s IP address, which you can find with the following command in your terminal.
ifconfig | grep addr
When you’ve done this, you might consider registering a domain, and forward it, or some sub-domain beneath it, to your external IP address. See the video for details about how I have done this. A domain typically costs you $10 annually.