CoreOS Container Linux on DigitalOcean

CoreOs Container Linux is very light in comparison with other Linux distributions and requires applications to run inside their containers.

Create SSH Key Pair For Server Authentication

Login to the server (Droplet) will be via SSH keys and not passwords. SSH keys come in pairs, one private and the other public. The private key is known only to you while the public key can be shared with any SSH server to which you would like to connect.

Open a Terminal window and type the following:

  ssh-keygen -f ~/.ssh/do-rsa  -t rsa -b 2048 

-f species the file name of the keys
-t is the type of keys to create
-b are number of bits in the key

You will not require a passphrase for this key.

After the process is complete, you get output similar to the following:

  ~$ ssh-keygen -f ~/.ssh/do-rsa  -t rsa -b 4096 
  Generating public/private rsa key pair.
  Enter passphrase (empty for no passphrase): 
  Enter same passphrase again: 
  Your identification has been saved in /Users/kagundajm/.ssh/do-rsa.
  Your public key has been saved in /Users/kagundajm/.ssh/do-rsa.pub.
  The key fingerprint is:
  SHA256:e1IRUFcVrulCNSDlIp0swNKVVpvwPIfXv8QO7OtVNcE kagundajm@kag01
  The key's randomart image is:
  +---[RSA 4096]----+
  |    o..o+=+o..o+o|
  |   . o.o* Boo .E.|
  |    . .o %.+ + o.|
  |        o =.o * o|
  |        S .. = +.|
  |         o. o + o|
  |        o .. o + |
  |         o  . o  |
  |            .o   |
  +----[SHA256]-----+
  ~$ 

DigitalOcean Login

Login to your DigitalOcean account. If you do not have an account with DigitalOcean, create a new account. Using the link will give you a $10 credit to start with.

Create Your Server (Droplet)

  1. Click on Create button and select Droplets

    alt=“DigitalOcean create droplet”

  2. Select Container distributions tab and under CoreOS select stable version

    alt=“DigitalOcean select droplet image”

  3. Select Droplet size

    alt=“DigitalOcean create droplet”

  4. Scroll down and select a data center region that is closest to your location

    alt=“DigitalOcean create droplet”

  5. Copy the contents of the public key you created earlier to the clipboard

    • From the Terminal type:

      cat  ~/.ssh/do-rsa.pub
      

      The command will display output similar to the following:

        ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCjLHmTmApuM0ckdo8YHqIaoZFyhUIxOP9LdvM41/sZxRtaigpc3Kjgc3hRe+scM7ikUaBYpfw7EdBjQJ4OgezvpYdRjCnMwHwrr4KY/iIJVTxEWkPkVVBfLl8xdGAMZFiXr8a+1LjASsnqJu1BhY04g3ZnniZrf/jii1pZ+5sfnK73SZWaLKI5Qseg1X6raNs4lQ4zFB6v9YCWLzk27tiLV3pnJDdaMMCNDVEyEafz4peJ9IGzyKihtQ4MG/Mb4OLw97sCs2NDK9Ts95NTOfDnXzSRtJnDq7BUGFC+jb7V6hvmX4w== kagundajm@kag01
      
    • Select and copy the output of the command starting from and including ssh-rsa to the end of the output

  6. Click New SSH Key

    • Paste the copied ssh key output under SSH key content
    • Type a name for the key
    • Clck on Add SSH key button alt=“DigitalOcean add new SSH key”
  7. If you want, you can change the name of your hostname of just use the provided name

  8. Click on Create button

    You will be re-directed to your Droplet page and a progress bar will be displayed as your Droplet is being created.

    alt=“DigitalOcean create Droplet progress”

    After the create process completes, an IP address for your Droplet will be displayed next to the Droplet name.

    A best practices for setting up your new CoreOS server email will also be sent to your email address.

Logging In to the new Droplet

From your local machine type the following command:

  ssh -i ~/.ssh/do-rsa core@45.45.283.61
`-i` specifies the ssh key to use
`core` is the default user created when we created our server/Droplet
`45.45.283.61` is the IP address of our Droplet

Type yes and press Enter key when asked whether to continue connecting.

After successful login, your prompt will change to something similar to

  core@coreos-s-1 ~ $ 

You can type exit to get back to your local machine prompt or play around with any linux commands while connected to the Droplet.