Micro

Micro addresses the key requirements for building services in the cloud. It leverages the microservices architecture pattern and provides a set of services which act as the building blocks of a platform.

Micro deals with the complexity of distributed systems and provides simpler programmable abstractions to build on.

Software Included

Package Version License
Micro 3.15.0 Apache 2.0
Go 1.19.3 BSD

Creating an App using the Control Panel

Click the Deploy to DigitalOcean button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.

Deploy to DO

Creating an App using the API

In addition to creating a Droplet from the Micro 1-Click App using the control panel, you can also use the DigitalOcean API. As an example, to create a 4GB Micro Droplet in the SFO2 region, you can use the following curl command. You need to either save your API access token) to an environment variable or substitute it in the command below.

curl -X POST -H 'Content-Type: application/json' \
         -H 'Authorization: Bearer '$TOKEN'' -d \
        '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image": "m3o-micro"}' \
        "https://api.digitalocean.com/v2/droplets"

Getting Started After Deploying Micro

Start by logging into the machine and creating a new Micro admin account

We have purposely changed the SSH port to avoid scanning

# SSH login
ssh -p 61194 root@your_droplet_public_ipv4

# Micro login
micro login --username admin --password micro

Generate Admin Account

Generate a new account with the admin scope (example user/pass john/password1)

micro auth create account --scopes=admin --secret=password1 john

Confirm you can login with this account using the command micro login

$ micro login
Enter username: john
Enter password: 
Successfully logged in.

Now delete the default admin account

micro auth delete account admin

Check you can see the core services are running

$ micro services
api
auth
broker
config
events
network
proxy
registry
runtime
store

You can now install the Micro CLI locally or continue to use it on the server.

Install the CLI

To install the CLI binary locally

Windows

powershell -Command "iwr -useb https://raw.githubusercontent.com/micro/micro/master/scripts/install.ps1 | iex"

Linux

wget -q  https://raw.githubusercontent.com/micro/micro/master/scripts/install.sh -O - | /bin/bash

MacOS

curl -fsSL https://raw.githubusercontent.com/micro/micro/master/scripts/install.sh | /bin/bash

Add Server Environment

From your local machine add your new server to the Micro env.

Make sure to replace $DROPLET_IP with your VMs external IP address. You can find this in the console or take it from the ssh root@your_droplet_public_ipv4 command.

# add the env
micro env add server $DROPLET_IP:8081
# switch to the env
micro env set server
# login
micro login

Ports to know

  • API - 8080
  • Proxy - 8081
  • Web - 8082

And now you’re ready to go!