LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lxc

manages Linux containers using the LXD REST API

TLDR

List containers
$ lxc list [match_string]
copy
List images
$ lxc image list [remote:][match_string]
copy
Create container from image
$ lxc init [remote:]image [container]
copy
Start container
$ lxc start [remote:]container
copy
Stop container
$ lxc stop [remote:]container
copy
Show container info
$ lxc info [remote:]container
copy
Take snapshot
$ lxc snapshot [remote:]container [snapshot_name]
copy
Execute command in container
$ lxc exec [remote:]container [command]
copy
Launch container (create + start)
$ lxc launch [remote:]image [container]
copy

SYNOPSIS

lxc command [options]

DESCRIPTION

lxc manages Linux containers using the LXD REST API. It provides a user-friendly interface for creating, managing, and interacting with system containers and virtual machines.

PARAMETERS

list

List containers
image list
List available images
init
Create container from image
start
Start container
stop
Stop container
info
Show container details
snapshot
Create container snapshot
exec
Execute command in container
launch
Create and start a container (combines init + start)
delete
Delete container
copy
Copy container
move
Move container between servers
file push|pull
Transfer files to/from container
config
Manage container configuration
profile
Manage container profiles
network
Manage networks
storage
Manage storage pools and volumes
remote
Manage remote servers
--debug
Show all debug messages
--force-local
Force using the local unix socket
-h, --help
Print help
--project PROJECT
Override the source project
-q, --quiet
Do not show progress information
-v, --verbose
Show all information messages

CAVEATS

Requires LXD daemon running (lxd init to configure). Container names can be prefixed with remote server names for cluster operations. Manages both system containers and virtual machines. Note that lxc (LXD client) is distinct from the older lxc-* tools (liblxc).

HISTORY

lxc is the command-line client for LXD, originally developed by Canonical starting in 2014 as a next-generation container manager. LXD provides system containers (similar to lightweight VMs) and virtual machines, managed through a REST API that the lxc client communicates with.

SEE ALSO

Copied to clipboard
Kai