Hi guys.

I’m new to deployment of a server and digital ocean.
I want to create an API Server that use go language and also want to create a database server using MySQL.

My question is :

  1. Can I deploy a Go Application + MySQL database into a single droplet ? Or must I use DigitalOcean Managed MySQL Database for the database ?
  2. What did I need to deploy a go API to digital ocean ? Is I only need to upload my binary go file to deploy it ? Or also need docker or something else like that ?

Thankyou.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello @dickywijayaa,

You can follow the steps here on how to deploy a Go Web application with Nginx:

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-go-web-application-using-nginx-on-ubuntu-18-04

By using Nginx, you will then be able to secure your web application by adding an SSL certificate, you can take a look at this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04

Regarding your MySQL question, you can install MySQL directly on your Droplet, I would recommend enabling backups for your Droplet so that if anything goes wrong, you would be able to restore to an older backup.

Hope that this helps!
Regards,
Bobby

by Hazel Virdó
by Kathleen Juell
In this tutorial, we will show you how to use Let's Encrypt to obtain a free SSL certificate and use it with Nginx on Ubuntu 18.04. We will also show you how to automatically renew your SSL certificate. If you're running a different web server, simply follow your web server's documentation to learn how to use the certificate with your setup.
Submit an Answer