---
title: Set up your development environment
description: Canonical makes open source secure, reliable and easy to use, providing
  support for Ubuntu and a portfolio of enterprise-grade technologies. Founded in
  2004, Canonical operates globally with team members in over 80 countries.
url: https://canonical.com/dqlite/docs/tutorials/setup-your-development-environment?format=md
---

*Submit*

# Set up your development environment

The following section walks you through the necessary steps to set up your environment.
It is recommended to spin up a clean Ubuntu VM for these steps as it is always good to perform experiments in an isolated development environment.
Follow the steps in [Set up an Ubuntu VM with Multipass](https://juju.is/docs/sdk/set-up-your-development-environment#heading--set-up-an-ubuntu-vm-with-multipass) to do this.

## [Create a project directory](https://canonical.com/dqlite/docs/tutorials/setup-your-development-environment?format=md#create-a-project-directory)

Create a project directory with

```
mkdir ~/go-dqlite-demo
cd ~/go-dqlite-demo
```

This creates a folder called `go-dqlite-demo` in your home directory and enters it. All project files will be put in this directory.

## [Install the Dqlite tooling](https://canonical.com/dqlite/docs/tutorials/setup-your-development-environment?format=md#install-the-dqlite-tooling)

On a Debian-based system, you can get the latest development release from [Dqlite’s development PPA](https://launchpad.net/~dqlite/+archive/ubuntu/dev). First add the PPA repository:

```
sudo add-apt-repo ppa:dqlite/dev
sudo apt update
```

Then install the library:

```
sudo apt install libdqlite-dev
```

> If you are not using a Debian-based system, you must build `libdqlite` from source. See [Build](https://github.com/canonical/dqlite#build) for instructions on how to do this.

# Install Go

Download and install the latest version of Go following the steps outlined in the [Go documentation](https://go.dev/doc/install).
You can verify that everything is installed correctly by typing the following command in your terminal:

```
> go version
go version go1.21.1 linux/amd64
```

Check that the output matches the version that you downloaded earlier.

In your project folder, create a mod file with:

```
go mod init go-dqlite-demo
```

Install the application bindings for `go-dqilite/app` with:

```
go get github.com/canonical/go-dqlite/app
```

> Read more about Go mod files in the [Go documentation](https://go.dev/ref/mod).

# Install a C compiler

A C compiler is required for the package to build. Install `gcc` with:

```
sudo apt install gcc
```

You should now be all set to start your first Go application. Continue with [Create an example application](https://canonical.com/dqlite/docs/tutorials/create-an-example-application).

---

[Previous

Get started with Dqlite in Go](https://canonical.com/dqlite/docs/tutorials/get-started-with-dqlite-in-go)
[Next

Create an example application](https://canonical.com/dqlite/docs/tutorials/create-an-example-application)

Last updated 2 years ago. [Help improve this document in the forum](https://discourse.dqlite.io/t/set-up-your-development-environment/72).
