# Incus: Exploring the Client CLI

Today, we will explore how to use Incus command line client to do basic management of Incus resources. If you need instructions on installing and setting up Incus server for the first time, please refer to my [my previous article](https://blog.msandwidi.net/incus-initial-server-setup). So, this article assume that you already have Incus server up and running.

I will try to keep things simple and brief here again, as [Incus documentation page](https://linuxcontainers.org/incus/docs/main/#) offers much more details on how to manage your workloads using the command line client.

In the following sections, I will:

1. Show you how to install Incus client on a Windows machine
    
2. Show you how to run basic commands
    
3. Tell you where to learn more about Incus command line client
    

## 1\. Install Incus Command Line Client

Incus client is the package that allows you to interact with Incus daemon. When you run the command `incus --help`, you are actually interacting with Incus client. It takes your commands and then forwards them to the daemon.

Incus client comes preinstalled with Incus server, so you won't need to install it on the machine where you host your containers and virtual machines.

However, if you want Incus server in a different location and Incus client on your workstation, you will need to install and set up the client.

To install Incus command line client on a Windows PC, you can use Chocolatey, Winget, or download the native build from [Incus client page](https://linuxcontainers.org/incus/docs/main/installing/#install-incus-from-a-package).

### **Installing Incus client using Chocolatey**

* Make sure you have Chocolatey installed:
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721926145498/dfdae27d-4e44-42e6-af71-2b15b435ed33.png align="center")
    
    Checkout [Chocolatey installation page](https://docs.chocolatey.org/en-us/choco/setup/) if you don't have it on your Windows computer yet.
    
* Install Incus client:
    
    `choco install incus`
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721926592284/af260622-cdea-47b8-b449-8807d9503408.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721926879295/35e583d1-e1db-49fb-8397-df782be475e4.png align="center")
    

For installing Incus client using other methods, please check out [this page](https://linuxcontainers.org/incus/docs/main/installing/#other-operating-systems) on Incus documentation page.

Once Incus client is installed, you need to connect it to the server to manage the resources..

### **How to add an Incus server the command line client?**

* Expose Incus API to the network. On the server, run::
    
    `incus config set core.https_address :8443`
    
    This commands make Incus API available on your network.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721932149824/39a1534a-5189-41b3-80f0-73c47aea51ad.png align="center")
    
* On the server, enter the following command:
    
    `incus config trust add <CLIENT_NAME>`
    
    Replace client name (`CLIENT_NAME`) with a descriptive name for your client. For example `my_laptop`.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721932307634/54658c79-0a54-4b96-af54-fbe2b8b4fd9b.png align="center")
    
* On the client, add the server by running the command:
    
    `incus remote add <SERVER_NAME>`
    
    Replace the server name (`SERVER_NAME`) with a descriptive name of you Incus server. For example `my_server_1`. Follow the prompt to add the token given to you by the server.
    
* Make sure you properly added you Incus server to the client. Run `incus remote list` to see all the servers your Incus client is connected to.
    

## 2\. Run Basic Commands using Incus Command Line Client

### **How to create a new container instance?**

To create an Incus container called `my-container`, run the following command:

`incus launch images:ubuntu/22.04 my-container`

By default, the command `incus launch` creates a system container. If you want a full virtual machine, you can use the `--vm` flag (`incus launch images:ubuntu/22.04 my-virtual-machine --vm`). There are more options available when creating a new instance, but we will not cover all of them today.

Stopping or deleting an instance is simple with `incus stop my-container` and `incus delete my-container`. To learn more about what you can do with Incus command line client, please visit the [official documentation](https://linuxcontainers.org/incus/docs/main/reference/manpages/incus/#synopsis) of Incus..

## 3\. Where to Go from Here

Incus project: [https://github.com/zabbly/incus](https://github.com/zabbly/incus)

Incus home page: [https://linuxcontainers.org/incus/introduction/](https://linuxcontainers.org/incus/introduction/)

Incus documentation: [https://linuxcontainers.org/incus/docs/main/](https://linuxcontainers.org/incus/docs/main/)

## Conclusion

Today, I wanted to introduce Incus command line client and show you how to install it on your machine. Incus client is supported on major operating systems, including macOS and Windows.

Just a quick reminder, Incus client comes with Incus server installation. This means you don't have to install the client separately on your server. You only need to install Incus client yourself if you want to manage your resources from a computer other than the one where you installed Incus server. After installing the command line client, expose Incus API to your network, add the server to the client, and you'll be ready to do some cool stuff..
