Pre-requisites
Setup
Download Mage maintained Terraform scripts.Terraform plan
You can run the following command to see all the resources that will be created by Terraform:1. Configure access token
Generate DigitalOcean access token by following the guide: https://developer.hashicorp.com/terraform/tutorials/applications/digitalocean-provider#generate-digitalocean-access-token Set the token inDIGITALOCEAN_ACCESS_TOKEN
environment variable
2. Create ssh key
Create ssh key with command:ssh-keygen
. In the file
./digitalocean/variables.tf, update the value of ssh_pub_key
to your path of public key.
3. Customize Terraform settings
Application name (optional) In the file ./digitalocean/variables.tf, you can change the default application name that will appear in DigitalOcean:4. Provision resources
Using CLI- Change directory into scripts folder:
- Initialize Terraform:
- Deploy:
5. Run app in the provisioned Droplet
SSH into the instance:ssh -i [path_to_private_key] root@[ip]
Run command to start Mage app in :
To update Mage to latest version, you can pull latest docker image with command:
docker run
command above.
6. Open browser with Mage
Once you’ve launched the Droplet and started Mage, you can access Mage from your web browser by entering the following:http://[ip]:[port]
Change the IP to match the IP of your Droplet and the port that you’re using for Mage.