How to Run a Supergiant Server on DigitalOcean

Posted by Brian Sage on December 20, 2016

By the end of this tutorial, you will have started Supergiant as a service on DigitalOcean.

Supergiant and Kubernetes are open source and free forever. However, DigitalOcean hardware usage rates apply.

For this tutorial, you will need:

  • A paid DigitalOcean account
  • A public/private key pair handy for accessing your DigitalOcean server via SSH

Prepare for Launch

Log in to your DigitalOcean account dashboard view. From there, DigitalOcean makes it very easy to provision cloud hardware.

Step 1: Create and Connect to Your Droplet

From your dashboard, click Create Droplet to get started. Start by choosing an image.

Click Create Droplet and select the Ubuntu image. I’ve selected 16.04, which is the long-term support release.

You will only need the 512MB / 1CPU size to run Supergiant as a service.

About block storage and region selection: You don’t need to select block storage for this server. The default server storage will be enough, and Supergiant will automatically provision block storage for your Kubernetes cluster later. However, if you want to run your Supergiant server in the same datacenter region as your Kubernetes cluster, select a region that allows block storage, like FRA1, NYC1, or SFO1.

Add your public key, so you can access the server’s terminal via SSH later. If you have already added SSH keys to your DigitalOcean account, be sure the key you want to use is checked.

Give your server a unique name and click Create.

Your Droplet will be up and running in minutes. Once it’s up, SSH into it using the public IP you retrieve from the dashboard.

Retrieve the IP Address of the Droplet you created.

On DigitalOcean Ubuntu 16.04, SSH using the username root and the keypair you added to the server above.

ssh -i /path/to/private_key root@162.243.174.132

Step 2: Get Supergiant

Always check the Supergiant latest release for the current server binary URL. As of this tutorial, the latest release is v0.13.2. Execute the following, which will download the Supergiant v0.13.2 server binary to your /usr/sbin/ directory:

curl https://github.com/supergiant/... -L -o /usr/bin/supergiant

Be sure to make the binary executable.

chmod +x /usr/bin/supergiant

Step 3: Configure Supergiant

We will grab the example configuration file from github and put it in a responsible place. We don’t recommend using these default settings in production, but the configuration will work as is for quick start and testing purposes.

Execute the following to download the example configuration file:

sudo curl https://raw.githubusercontent.... --create-dirs -o /etc/supergiant/config.json

Use your favorite text editor to change the following configuration parameters in config.json to fit our Ubuntu environment:

{
 ...
 "sqlite_file": "/var/lib/supergiant/development.db",
 ...
 "log_file": "/var/log/supergiant/development.log",
 ...
}

Create the directories we just referenced so Supergiant can write its DB and log files:

sudo mkdir /var/lib/supergiant && sudo mkdir /var/log/supergiant

Next configure systemd to start Supergiant as a service. Use your favorite editor to create the following init file at /etc/systemd/system/supergiant.service:

[Unit]
Description=Supergiant Server
After=syslog.target
After=network.target
[Service]
ExecStart=/usr/bin/supergiant --config-file /etc/supergiant/config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target

Step 4: Create an Admin User

The first time Supergiant runs, an admin user will be created, and the service will output the username and password to the console.

Execute the following in the terminal to test your configuration and create your admin user:

sudo supergiant --config-file /etc/supergiant/config.json

You will see the terminal output something like the following:


Save the randomly generated password, so you can access the dashboard later. Type Control+C to stop the server after the user is created.

If you have any trouble by this point, please join us on our Slack channel.

Step 5: Start Your Supergiant Server

Start your new Supergiant system service like so:

sudo systemctl start supergiant.service

The system shouldn't produce any output if this is successful.

To check the status of the service, you may execute the following:

sudo systemctl status supergiant.service

Last, enable the service to start on bootup:

sudo systemctl enable supergiant.service

Access your Supergiant Dashboard

By default in development mode, Supergiant serves HTTP over port 8080 and Ubuntu’s simple firewall is off.

To access the dashboard, simply get the IP of our server from your DigitalOcean droplets list, put the IP, followed by port number:8080 in a web browser to access your Supergiant dashboard on its default port (or whatever port you may have customized in your config.json file above), then use the username "admin" and the password generated above to log in.

That’s it! You’ve successfully created a Supergiant server that runs as a service for development purposes!

Access the Supergiant Community

Remember, if you have trouble, or if you want to talk to other users about how they're making the most of Supergiant, our community hangs out on the Supergiant public Slack channel.

We would love any feedback you want to leave. We're working hard to add features that our community wants most, so all your comments are helpful to us. Visit the Supergiant Slack channel, and post your questions and comments.

Whereto Next?

This tutorial is one in a series to help you get started with Kubernetes using Supergiant. From here we recommend you check out the following:

comments powered by Disqus