Now that we have the components to build our cheap little server, we need an Operating System. My flavor of OS, is RancherOS. It’s a tiny little OS, specifically designed to run docker containers. What are docker containers?
Our little server is going to dish out a lot of stuff. We are going to do this, using docker containers. In short, a docker container is it’s own little machine with an OS. I started playing with this a few months ago, figuring it out, etc…Then I turned it into production. Currently, my production server is running over 30 containers. That’s 30 seperate operating systems, most of which are running a web server of sometype, or a database. Each container has its own private IP address and if I open it to the public, a web address. Using a reverse proxy, I am dishing out all of these web servers through port 443, securely, with SSL certificates. What am I running?
Starting with the base OS, RancherOS, the OS itself is, infact, a container. Upgrading is a breeze.Setting up RancherOS, is actually not a breeze. But in the end, you will have a server running, the SSH port 22 can be opened, but best to only open to known IPs, and the log in will only accept you with an SSH-key for added security.
Next, we need a reverse proxy. Easiest one to use and setup, nginx-proxy, which has a companion, LetsEncrypt. The proxy is going to let you serve all your websites out of the standard ports, 80 & 443, and then proxy requests to your containers, aka servers, on the backends, regardless of what those ports are. The LetsEncrypt companion, will talk to the proxy and automatically get certificates for your sites, the ones that tell your users that it is a trusted and secure site. Without the proxy loaded and running, you will be limited to opening ports on your IP to reach your webaddresses, i.e. example.com:9000. No one wants to :9000 at the end of a site, and to be honest, you are opening up security risks by opening up those ports.
Now for the main server, Rancher. Rancher is memory intensive, so this will take 1 to 1 and a half gigs of ram off the top.
Not a neccesity, but nice to have. The OS is technically the “Server,” this is more of a management tool, Portainer, can be just as effective, but with RancherOS, you can’t deploy stacks without Rancher. What’s a stack? We’ll get there.I am running both, Portainer and Rancher. To be honest, they both have their uses. Assuming your proxy is up and running, and you point your domain and sub domains to your IP address, proxying to your Rancher Server is as easy as adding a few environmental variables to your docker run command.
docker run -d \ -e VIRTUAL_HOST=rancher.example.com \ -e VIRTUAL_PORT=8080 \ -e LETSENCRYPT_HOST=rancher.example.com \ -e LETSENCRYPT_EMAILfirstname.lastname@example.org \ --restart=unless-stopped \ -p 8080:8080 rancher/server
See, that’s easy…
What else do we want to run
Anything we want. You can find open source software to serve almost any purpose. But, here is my list in no particular order:
- Samba – Network file server
- OpenLDAP – Directory to store users and passwords
- Self-Service Password – Allows users to manage their own passwords
- Huginn – does lots of things, webscrape data from all your competitors websites, report to you when new items appear, basically your own personal agent that you can program to do what you want, and can connect to just about any api. He’s a cool cat, and fun guy…I have Huginn connected to Hubot on my chat server, so, he is somewhat interactive. Here’s a good video on huginn.
- Kanboard – Project Management Software, by far my favorite. The base code is easily modifyable to suite almost any need, and creating you own plugins is simple and straightforward.
- ResourceSpace – Great Image tool, really love the Google vision connection, you upload images and google runs recognition, creating all your meta data. Awesome-sauce…
- phpldapadmin – For administration of your OpenLDAP server
- Duplicati – Automated backups
- Ghost – Blogging software (thats what this is)
- Minio – Blob file storage management, where all my backups go.
- Akeneo – Product Information Managment, love akeneo.
- Seafile – File sync and sharing, a lot like dropbox.
- Rocket.chat – Chat server
- Portainer – Docker management
- Rancher – Server Management
A good source
To find other great open source software, check out: Awesome self hosted
Hey, my man, what it look like…