Introduction

An instance is a virtual server running on the Civo cloud platform. They can be of variable size and you can run any number of them up to your quota on your account.

Creating an instance

You can create an instance by running civo instance create with a hostname parameter, as well as any options you provide:

Options:
  -t, --diskimage string     the instance's disk image (from 'civo diskimage ls' command)
  -l, --firewall string      the instance's firewall you can use the Name or the ID
  -h, --help                 help for create
  -s, --hostname string      the instance's hostname
  -u, --initialuser string   the instance's initial user
  -r, --network string       the instance's network you can use the Name or the ID
  -p, --publicip string      This should be either "none" or "create" (default "create")
  -i, --size string          the instance's size (from 'civo instance size' command)
  -k, --sshkey string        the instance's ssh key you can use the Name or the ID
  -g, --tags string          the instance's tags
  -w, --wait                 wait until the instance's is ready

Example usage:

$ civo instance create --hostname=api-demo.test --size g3.small  --diskimage=12745392-15c7-4140-925d-441fe7ae57fd --initialuser=demo-user
  The instance api-demo.test has been created

$ civo instance show api-demo.test
              ID : 112f2407-fb89-443e-bd0e-5ddabc4682c6
        Hostname : api-demo.test
          Status : ACTIVE
            Size : g3.small
       Cpu Cores : 1
             Ram : 2048
        SSD disk : 25
          Region : LON1
      Network ID : 28244c7d-b1b9-48cf-9727-aebb3493aaac
   Disk image ID : ubuntu-bionic
     Snapshot ID : 
    Initial User : demo-user
Initial Password : demo-user
         SSH Key : 
     Firewall ID : c9e14ae8-b8eb-4bae-a687-9da4637233da
            Tags : 
      Created At : Mon, 01 Jan 0001 00:00:00 UTC
      Private IP : 192.168.1.7
       Public IP : 74.220.21.246

----------------------------- NOTES -----------------------------

You will be able to see the instance's details by running civo instance show api-demo.test as above.

Disk images and instance sizes

You can view the Disk images by running civo diskimage ls sh $ civo disk image ls +--------------------------------------+---------------+---------+-----------+--------------+ | ID | Name | Version | State | Distribution | +--------------------------------------+---------------+---------+-----------+--------------+ | 4921b107-964f-417c-bf63-c92fcf41ccbd | centos-7 | 7 | available | centos | | a4204155-a876-43fa-b4d6-ea2af8774560 | debian-10 | 10 | available | debian | | 9b661c46-ac4f-46e1-9f3d-aaacde9b4fec | debian-9 | 9 | available | debian | | 12745392-15c7-4140-925d-441fe7ae57fd | ubuntu-bionic | 18.04 | available | ubuntu | | d927ad2f-5073-4ed6-b2eb-b8e61aef29a8 | ubuntu-focal | 20.04 | available | ubuntu | +--------------------------------------+---------------+---------+-----------+--------------+ You can view the instance sizes list by runing civo size ls

$ civo size ls 
+----------------+-------------+------------+-----+-------+-----+------------+
| Name           | Description | Type       | CPU | RAM   | SSD | Selectable |
+----------------+-------------+------------+-----+-------+-----+------------+
| g3.xsmall      | Extra Small | Instance   |   1 |  1024 |  25 | Yes        |
| g3.small       | Small       | Instance   |   1 |  2048 |  25 | Yes        |
| g3.medium      | Medium      | Instance   |   2 |  4096 |  50 | Yes        |
| g3.large       | Large       | Instance   |   4 |  8192 | 100 | Yes        |
| g3.xlarge      | Extra Large | Instance   |   6 | 16384 | 150 | Yes        |
| g3.2xlarge     | 2X Large    | Instance   |   8 | 32768 | 200 | Yes        |
| g3.k3s.xsmall  | Extra Small | Kubernetes |   1 |  1024 |  15 | Yes        |
| g3.k3s.small   | Small       | Kubernetes |   1 |  2048 |  15 | Yes        |
| g3.k3s.medium  | Medium      | Kubernetes |   2 |  4096 |  15 | Yes        |
| g3.k3s.large   | Large       | Kubernetes |   4 |  8192 |  15 | Yes        |
| g3.k3s.xlarge  | Extra Large | Kubernetes |   6 | 16384 |  15 | Yes        |
| g3.k3s.2xlarge | 2X Large    | Kubernetes |   8 | 32768 |  15 | Yes        |
+----------------+-------------+------------+-----+-------+-----+------------+

Viewing the Default User Password For an Instance

You can view the default user's password for an instance by running civo instance password ID/hostname

$ civo instance password api-demo.test
The instance api-demo.test (112f2407-fb89-443e-bd0e-5ddabc4682c6) has the password BrbXNW2RUYLe (and user demo-user)

You can also run this command with the option -o and -f to get only the password output, useful for scripting situations:

$ civo instance password api-demo.test -o custom -f Password
BrbXNW2RUYLe

Viewing Instance Public IP Address

If an instance has a public IP address configured, you can display it using civo instance public-ip ID/hostname:

$ civo instance public-ip api-demo.test -o custom -f public_ip
74.220.21.246

The above example uses -o and -f to display only the IP address in the output.

Setting Firewalls

Instances can make use of separately-configured firewalls. By default, an instance is created with default all port open firewall rules set. If you want to secure your instances more, so you will need to configure some rules (see Firewalls for more information). Once you have configured the rules you can check it by running civo firewall ls

$ civo firewall ls
+--------------------------------------+------------------------------------+---------+-------------+-----------------+
| ID                                   | Name                               | Network | Total rules | Total Instances |
+--------------------------------------+------------------------------------+---------+-------------+-----------------+
| c9e14ae8-b8eb-4bae-a687-9da4637233da | Default (all open)                 | Default |           3 |               0 |
| f79db64d-41f0-4be0-ae80-ce4499164319 | Kubernetes cluster: Demo           | Default |           2 |               0 |
+--------------------------------------+------------------------------------+---------+-------------+-----------------+

You can take the firewall ID and use it to associate a firewall with an instance, use the command civo instance firewall ID/hostname firewall_id. For example:

$ civo instance firewall api-demo.test f79db64d-41f0-4be0-ae80-ce4499164319
Set the firewall for the instance api-demo.test (112f2407-fb89-443e-bd0e-5ddabc4682c6) to Kubernetes cluster: Demo (f79db64d-41f0-4be0-ae80-ce4499164319)

Listing Instances

You can list all instances associated with a particular API key by running civo instance list.

Listing Instances sizes

You can list all instances sizes by running civo instance size.

Rebooting/Restarting Instances

A user can reboot an instance at any time, for example to fix a crashed piece of software. Simply run civo instance reboot instanceID/hostname. You will see a confirmation message:

$ civo instance reboot api-demo.test
 Rebooting api-demo.test. Use 'civo instance show api-demo.test' to see the current status.

If you prefer a hard reboot, you can run civo instance hard-reboot instanceID/hostname instead.

Removing Instances

You can use a command to remove an instance from your account. This is immediate, so use with caution! Any snapshots taken of the instance, as well as any mapped storage, will remain. Usage: civo instance remove instanceID/hostname. For example:

$ civo instance remove api-demo.test
The instance (api-demo.test) has been deleted

Stopping (Shutting Down) and Starting Instances

You can shut down an instance at any time by running civo instance stop instanceID/hostname:

$ civo instance stop api-demo.test
 Stopping api-demo.test. Use 'civo instance show api-demo.test' to see the current status.

Any shut-down instance on your account can be powered back up with civo instance start instanceID/hostname:

$ civo instance start api-demo.test
 Starting api-demo.test. Use 'civo instance show api-demo.test' to see the current status.

(Re)Tagging an Instance

Tags can be useful in distinguishing and managing your instances. You can retag an instance using civo instance tags instanceID/hostname 'tag1 tag2 tag3...' as follows:

$ civo instance tags api-demo.test 'ubuntu demo'
 The instance api-demo.test (b5f82fa7-b8e4-44aa-9dda-df02dab71d6c) has been tagged with ubuntu demo. Use 'civo instance show api-demo.test' to see the current tags.'
$ civo instance show api-demo.test
              ID : b5f82fa7-b8e4-44aa-9dda-df02dab71d6c
        Hostname : api-demo.test
          Status : SHUTOFF
            Size : g3.small
       Cpu Cores : 1
             Ram : 2048
        SSD disk : 25
          Region : LON1
      Network ID : 28244c7d-b1b9-48cf-9727-aebb3493aaac
   Disk image ID : ubuntu-bionic
     Snapshot ID : 
    Initial User : demo-user
Initial Password : demo-user
         SSH Key : 
     Firewall ID : c9e14ae8-b8eb-4bae-a687-9da4637233da
            Tags : ubuntu demo
      Created At : Mon, 01 Jan 0001 00:00:00 UTC
      Private IP : 192.168.1.7
       Public IP : 74.220.16.23

----------------------------- NOTES -----------------------------

Updating Instance Information

In case you need to rename an instance or add notes, you can do so with the instance update command as follows:

$ civo instance update api-demo.test --hostname api-demo-renamed.test --notes 'Hello, world!'
The instance api-demo-renamed.test (b5f82fa7-b8e4-44aa-9dda-df02dab71d6c) has been updated

$ civo instance show api-demo-renamed.test
              ID : 715f95d1-3cee-4a3c-8759-f9b49eec34c4
        Hostname : api-demo-renamed.test
          Status : ACTIVE
            Size : g3.small
       Cpu Cores : 1
             Ram : 2048
        SSD disk : 25
          Region : LON1
      Network ID : 28244c7d-b1b9-48cf-9727-aebb3493aaac
   Disk image ID : ubuntu-bionic
     Snapshot ID : 
    Initial User : demo-user
Initial Password : demo-user
         SSH Key : 
     Firewall ID : c9e14ae8-b8eb-4bae-a687-9da4637233da
            Tags : 
      Created At : Mon, 01 Jan 0001 00:00:00 UTC
      Private IP : 192.168.1.7
       Public IP : 74.220.21.246

----------------------------- NOTES -----------------------------

Hello, world!

You can leave out either the --name or --notes switch if you only want to update one of the fields.

Upgrading (Resizing) an Instance

Provided you have room in your Civo quota, you can upgrade any instance up in size. You can upgrade an instance by using civo instance upgrade instanceID/hostname new_size where new_size is from the list of sizes at civo sizes ls:

$ civo instance upgrade api-demo-renamed.test g3.medium
 The instance api-demo-renamed.test (9579d478-a09e-4196-a08c-f52545a90fea) is being upgraded to g3.medium

$ civo instance show api-demo-renamed.test
          Status : ACTIVE
            Size : g3.medium
       Cpu Cores : 2
             Ram : 4096
        SSD disk : 50
          Region : LON1
      Network ID : 28244c7d-b1b9-48cf-9727-aebb3493aaac
   Disk image ID : ubuntu-bionic
     Snapshot ID : 
    Initial User : demo-user
Initial Password : demo-user
         SSH Key : 
     Firewall ID : c9e14ae8-b8eb-4bae-a687-9da4637233da
            Tags : ubuntu, demo
      Created At : Mon, 01 Jan 0001 00:00:00 UTC
      Private IP : 192.168.1.9
       Public IP : 74.220.17.71

----------------------------- NOTES -----------------------------

Hello, world!

Please note that resizing can take a few minutes.