Development & Server Setup 2019

Development & Server Setup 2019


Mar 19 2019, 12:00 in Web Development

When I started developping LaravelPackages.net and it's search module, I quickly noticed that Algolia was not going to be enough for this project. There are dozen of hundreds laravel packages out there that I needed to index. I naturally checked Elastic Search and tried it on my local machine for the first time. Worked like a charm!

But using Elastic Search in production is a whole other thing. Installing it on my main server could complicate a lot of things especially as I have several client production website hosted there, I didn't want to take the risk to run those websites + Redis + Elastic Search on the same machine. It would have consumed way too much RAM.

So I started investigating VPS, and Laravel Forge.

After some research and thinking I decided to move some of my web applications from my server and use cheaper third party services to serve my needs.

In other words, here's my complete infrastructure stack that I use to run personnal projects + clients projects.

Dedicated Server

I own a (pretty big) dedicated server, costing ~100€ per month. I use it for a lot of stuff, including:

  • Host a TeamSpeak Server for my gaming community
  • Host a Minecraft Server
  • Host all my side projects
  • Host all the "dev version" of my clients projects.
  • Host a Plex Media Server
  • Host a Web Torrent Client (Transmission)
  • Runs Redis for some projects
  • Host Databases for those projects
  • Host some production client projects (that have low trafic)

This server provided by OVH. I'm pretty happy with it.

Domain Registrar

As my server is provided by OVH, I also use OVH to buy my domain names.

DNS Manager

Every Time I buy a domain I immediately use CloudFlares name servers. CloudFlares is free and gives you incredible benefits like analytics and caching.

Git Repository

Now that Github allows you the have unlimited private repositories, I simply host all of my projects on Github. Simple and perfect and.. free!

VPS

For some client project that have high trafic, I use Laravel Forge to setup VPS with Hetzner and Digital Ocean.

External Service: Mailing

I use Mailgun. Easy to setup, has a free plan. Works perfectly!

Search Functionnality

For projects that have less than 10k records, I simply use Algolia (with Laravel Scout). It's insanely easy to setup and blazing fast! And it has a free plan! I have multiple projects using Algolia free plan in production.

For projects that have more than 10k records, I use a self hosted Elastic Search server on a 12€/month VPS at Hetzner. Still cheaper than Algolia paid plans.

Deployments

When I push new code on my github repositories, I trigger an automated deployment to update the code on my server. To do that, I ues Gitlab CI.

And guess what, it's free!

On gitlab, you can import Github Repositories and setup deployment pipelines. So pushing your code on github will trigger the gitlab pipeline.

The pipeline will build the project and run the Test Suite. If everything passes, gitlab trigger a Laravel Envoy script to deploy on the server.

I had to setup a "deployer" user on my server. Laravel Envoy will ssh into my server as the "deployer" user, and execute every command lines necessary to update the code, flush the cache, etc.

So again, my Continuous Delivery system costs me... 0€ YAY!

That's it !


Share:
Like:

Disable AdBlock on this domain and offer me a cup of coffee :)