How are you hosting your apps?

github logo ・1 min read

Hey Guys,

I have been trying to wrap my head around getting cheap and easy PaaS/IaaS/VPS for my side projects.

I would like to host my web apps under a single roof. My apps vary in the stack, some are in node.js, some I got built from friends using vanilla PHP, some are built on rails. Some are backed by services like Redis/RabbitMQ, while others may or may not use Docker.

Is there a way to host all of these under a single server without going crazy? Or should I stick with hosting each one of them in a separate environment (Heroku, AWS LightSail, GoDaddy CPanel) bearing the additional cost of maintaining them separately?

twitter logo DISCUSS (4)
markdown guide
 

Since you have a variety of tools, languages, services and containers, I'd suggest some sort of virtualization over alternatives (app-engines like GAE or heroku).

LightSail may be a good option since the pricing is explicit but I think you'd get more using DigitalOcean.

For side-projects of mine that are mature and actually used, I host them on DigitalOcean. For the other side-projects that are half-baked, in dev, or hardly used, I self-host those on my computers at home.

If you want to self-host there are several options that make it easy. One of my mature side-projects (packetriot.com) is a system that lets me do just this. Here are several choices:

Serveo.net - Free, uses openssh as its client, basically does remote-local port forwarding, worth checking out first.

Ngrok.com - Freemium, uses a reverse tunnel, it has a built-in tool for saving and replaying HTTP respects, it was developed with webhook dev in mind but it can relay HTTP/HTTPS.

Packetriot.com - Freemium, this is my project, it uses reverse tunnels as well, the client has support for automatic Let's Encrypt, can host static content (no need for extra web servers), is containerized, can perform upstream service checks, monitoring and notification on failures, provides access on who is connecting to your tunnels, and a few other tricks.

There are more, but these are the most popular. Serveo is quick and easy to test out to try out the concept of self-hosting, so I would do that first. If you need more or want more features try the other two.

I actually host several sites and services, including a Gitlab, private file-hosting, Upspin server, and a bunch of static websites behind a packetriot tunnel.

 

Is there a way to host all of these under a single server...

Since a "server" is just a computer (physical or virtual) listening to various ports, it is indeed possible.

...without going crazy?

Most likely not. The entire subject or microservices is based on the idea of not going crazy when you have multiple apps each with its own types of technology requirements.

FWIW, I have about 3 or 4 "apps" (depending on how you measure it) running on one instance, but the main application was purpose-built to support multiple "apps." To say it another way, if you start a new project and say, "I want to support multiple apps on this one server to maximize reuse," it is possible if the all use the same stack, but that should be your deliberate intention from your first line of code. Should I decide to split an "app" away from the main application, it would only be a few hours of work moving common libraries into shared dependencies and creating new entry points. I find this method of service deposition more effective than guessing which services should be decomposed ahead of time.

 

First, I wouldn't host them all on one server for sanity reasons. Use at least one server per application platform, or better yet one per app.

As far as the actual hosting, look into all-in-one VPS solutions. Vultr is my personal preference (disclaimer, that's an invite link, following it and signing up will net you a 50 USD credit on your new account with which to test the platform, and will also get me credit on my account if you open an account). Their pricing is dead simple to understand, they have good customer service, and they let you deploy certain application stacks (most notably Docker, LAMP, or LEMP) directly in a single click (which makes setup much simpler).

Other similar options include AWS LightSail (slightly better pricing than Vultr currently, I've been considering switching), Digital Ocean (currently the same pricing as Vultr), and Linode (slightly worse pricing than Vultr right now).

 
Classic DEV Post from Dec 21 '18

What is the hardest thing about learning to code?

Coding is hard. I struggled to learn for the first several years because I wasn't active within the dev community. What was the hardest thing you've experienced on your coding journey?

Hammad Siddiqui profile image

dev.to is where software developers stay in the loop and avoid career stagnation.

Sign up (it's free!)