MCPcopy Index your code
hub / github.com/canonical/lxd

github.com/canonical/lxd @lxd-6.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release lxd-6.9 ↗ · + Follow
13,144 symbols 63,775 edges 1,237 files 9,063 documented · 69% 129 cross-repo links updated 1d agolxd-5.0.7 · 2026-07-01★ 4,793366 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LXD

LXD is a modern, secure and powerful system container and virtual machine manager.

It provides a unified experience for running and managing full Linux systems inside containers or virtual machines. LXD supports images for a large number of Linux distributions (official Ubuntu images and images provided by the community) and is built around a very powerful, yet pretty simple, REST API. LXD scales from one instance on a single machine to a cluster in a full data center rack, making it suitable for running workloads both for development and in production.

LXD allows you to easily set up a system that feels like a small private cloud. You can run any type of workload in an efficient way while keeping your resources optimized.

You should consider using LXD if you want to containerize different environments or run virtual machines, or in general run and manage your infrastructure in a cost-effective way.

Get started

See Getting started in the LXD documentation for installation instructions and first steps.

Status

Type Service Status
Tests GitHub Build Status
Go documentation Godoc GoDoc
Static analysis GoReport Go Report Card

Installing LXD from packages

The LXD daemon only works on Linux but the client tool (lxc) is available on most platforms.

OS Format Command
Linux Snap snap install lxd
Windows Chocolatey choco install lxc
macOS Homebrew brew install lxc

The LXD snap packaging repository is available here.

For more instructions on installing LXD for a wide variety of Linux distributions and operating systems, and to install LXD from source, see How to install LXD in the documentation.

Client SDK packages

The LXD project provides SDK client packages for interacting with LXD servers from your own software.

These SDKs are licensed as Apache-2.0.

Language URL
Go https://pkg.go.dev/github.com/canonical/lxd/client
Python https://github.com/canonical/pylxd

For more information on using the LXD API, see REST API in the documentation.

Tools for managing LXD

If you are looking for tools (beyond lxc CLI) to manage LXD at scale (from single server to wide clusters), the following projects can be useful:

Tool Link
Ansible - connection plugin https://galaxy.ansible.com/ui/repo/published/community/general/content/connection/lxd/
Ansible - inventory plugin https://galaxy.ansible.com/ui/repo/published/community/general/content/inventory/lxd/
Bolt - LXD transport https://www.puppet.com/docs/bolt/latest/bolt_transports_reference.html#lxd
MicroCloud https://canonical.com/microcloud
Packer - LXD builder https://developer.hashicorp.com/packer/integrations/hashicorp/lxd/latest/components/builder/lxd
Terraform provider https://registry.terraform.io/providers/terraform-lxd/lxd

Security

Consider the following aspects to ensure that your LXD installation is secure:

  • Keep your operating system up-to-date and install all available security patches.
  • Use only supported LXD versions (LTS releases or the latest feature release).
  • Restrict access to the LXD daemon and the remote API.
  • Configure your network interfaces to be secure.
  • Do not use privileged containers unless required. If you use privileged containers, put appropriate security measures in place.

See Container security for more information.

See Security for detailed information.

IMPORTANT:

Local access to LXD through the Unix socket always grants full access to LXD. This includes the ability to attach file system paths or devices to any instance as well as tweak the security features on any instance.

Therefore, you should only give such access to users who you'd trust with root access to your system.

Community support

You can seek support from the LXD developers as well as the wider community through the following channels.

Forum

Ask questions or engage in discussions: https://discourse.ubuntu.com/c/project/lxd/

Documentation

Access the official documentation: https://documentation.ubuntu.com/lxd/latest/

Bug reports and feature requests

To file a new bug or feature request, submit an issue on GitHub.

Other community resources

You can find additional resources on the LXD website, on YouTube, and the community-created tutorials.

Commercial support

LTS releases of LXD receive standard support for five years, which means they receive continuous updates. Commercial support for LXD is provided as part of Ubuntu Pro (both Infra-only and full Ubuntu Pro), including for attached LXD instances running Ubuntu. See the full service description for details.

Managed solutions and firefighting support are also available for LXD deployments. See: Managed services.

Contributing

Fixes and new features are greatly appreciated. Make sure to read our contributing guidelines first!

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 7,402
Function 3,819
Struct 1,629
TypeAlias 152
Interface 94
FuncType 48

Languages

Go100%
TypeScript1%
Python1%

Modules by API surface

client/interfaces.go401 symbols
lxd/db/cluster/generated.go155 symbols
lxd/instance/drivers/driver_qemu.go147 symbols
lxc/auth.go135 symbols
lxd/network/driver_ovn.go130 symbols
lxd/migration/migrate.pb.go124 symbols
shared/entity/type.go120 symbols
lxd/instance/drivers/driver_lxc.go116 symbols
lxd/storage/backend_lxd.go110 symbols
lxd/network/openvswitch/ovn.go105 symbols
lxd/db/cluster/update.go100 symbols
lxd/instance/instance_interface.go98 symbols

Dependencies from manifests, versioned

4d63.com/gocheckcompilerdirectivesv1.4.0 · 1×
cel.dev/exprv0.25.2 · 1×
charm.land/lipgloss/v2v2.0.4 · 1×
codeberg.org/chavacava/garifv0.2.1 · 1×
codeberg.org/polyfloyd/go-errorlintv1.9.0 · 1×
dev.gaijin.team/go/exhaustruct/v4v4.0.0 · 1×
github.com/4meepo/tagalignv1.4.3 · 1×
github.com/Abirdcfly/dupwordv0.1.8 · 1×
github.com/AdminBenni/iota-mixingv1.0.0 · 1×
github.com/AlwxSin/noinlineerrv1.0.5 · 1×

For agents

$ claude mcp add lxd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page