DEV Community

Cover image for Hosting Several Go sites on one VPS
Go4WebDev
Go4WebDev

Posted on

Hosting Several Go sites on one VPS

https://hosting.go4webdev.org/howto

Hosting MANY Go executables is different from hosting PHP or similar. You have to set the Go to listen to different ports. And then tell Nginx proxy (redirect) which Go executable to open. This mini tutorial guides you how to set up a VPS and create a "Go Hosting".

Webmin is a tool to manage the entire VPS Host. Amongst other things, upload, config and monitor.

By using Cloudflare in front as an extra proxy you can add several cool things. Amongst others can Cloudflare handle the SSL certificate for your entire server if you want. The sites are cached automatically and if you want Cloudflare can compress your code for faster rendering.

When adding systemd support to each Go executable you make it simpler to restart Go. Both manually and automatically.

If you host only ONE Go executable, there is no need for Nginx. Just use port 80 and 443 as usual.

Top comments (3)

Collapse
 
victorrims68524 profile image
Rimsha Victor Gill

Thank you for sharing your insights on hosting multiple Go executables and the benefits of using Cloudflare and Systemd.

Collapse
 
darshana0611 profile image
Darshana0611

@go4webdev Nice post . Do check our VPS hosting plans on Webnexs VPS servers and Webnexs' Cloud VPS

Collapse
 
go4webdev profile image
Go4WebDev

Thank you!