As I’ve often griped before, my cloud service provider (cloudatcost.com) is not exactly reliable. I’m currently on Day 3 waiting for their tech support to address several downed servers. Three days isn’t even that bad considering I’ve waited up to two weeks in the past. In any case, though I wish them success, I’m sick of their nonsense and am starting to migrate my servers out of the cloud and into my house. As a cloud company that routinely loses its customers’ data, it’s prudent to prepare for their likely bankruptcy and closure.
I have an old smashed-up AMD Quad Core laptop I’m going to use as a server. The screen was totally broken, so as a laptop it’s kind of useless anyway. It’s a little lightweight on resources (only 4 GB of RAM), but this is much more than I’m used to. I used
unetbootin to create an Ubuntu 16.04 bootable USB and installed the base system.
What follows are the common steps I take when setting up a production server. This bare minimum approach is a process I repeat frequently, so it’s worth documenting here. Once the OS is installed…
The install should put the created user into the
sudo group. Change the
root password with that user:
An interesting thing happened during install… I couldn’t install additional software (i.e.,
open-ssh), so I skipped it. When it came time to install
vim, I discovered I didn’t have access to any of the repositories. The answer here shed some light on the situation, but didn’t really resolve anything.
I ended up copying the example
sources.list from the documentation to fix the problem:
I found out later that this contained all repositories for Ubuntu 14.04. So I ended up manually pasting this in
After that, update/upgrade worked (make sure it doesn’t actually work before messing around):
The first thing I do is configure my machine for remote access. As above, I couldn’t install
open-ssh during the OS installation, for some reason. After
sources.list was sorted out, it all worked:
Check the official Ubuntu docs for configuration tips.
While I’m here, though, I need to set a static IP…
Paste this (or similar) under
# The primary network interface, as per lewis4u.
Then flush, restart, and verify that the settings are correct:
ssh didn’t start running automatically after install. I did this to make
ssh run on startup:
And then I did this, which actually starts the service:
This step, of course, depends entirely on the make and model of router behind which the server is operating. For me, I access the adminstrative control panel by logging in at
192.168.0.1 on my LAN.
I found the settings I needed to configure on my Belkin router under Firewall -> Virtual Servers. I want to serve up web apps (both HTTP and HTTPS) and allow SSH access. As such, I configured three access points by providing the following information for each:
- Inbound ports (i.e., 22, 80, and 443)
- TCP traffic type (no UDP)
- The private/static address I just set on my server
- Inbound private ports (22, 80, and 443 respectively)
Again, this depends on where you registered your domain. I pointed a domain I have registered with GoDaddy to my modems’s IP address, which now receives requests and forwards them to my server.
With my server, router, and DNS all properly configured, I don’t need to be physically sitting in front of my machine anymore. As such, I complete the following steps logged in remotely.
I like to have one user account control app deployment. Toward that end, I create an
app user and add him to the
Won’t get far without
My favourite editor is
vim, which is not installed by default.
Add this to the
Save and exit:
Now, when running
ctrl-n to toggle the file tree view.
Current installation instructions can be found here. The distilled process is as follows:
You can verify the key fingerprint:
Which should return something like this:
Add repository and update:
docker user group:
Add yourself to the group:
app user to the group as well:
Logout, login, and test
If everything works, you should see the usual Hello, World! message.
docker to start on boot:
This downloads the current stable version. Cross reference it with that offered here.
Install command completion while still
These steps are distilled from here.
The steps followed conclude with installing
rails. I only install
That last step can take a while…
There it is… all my usual favourites on some busted up piece of junk laptop. I expect it to be exactly 1000% more reliable than cloudatcost.com.