Skip to content

Everyday instance administration

This is the daily command page: create, inspect, enter, change, snapshot, and delete instances.

List and inspect

incus list
incus list --format compact
incus info web-01
incus config show web-01
incus config show web-01 --expanded

Use --expanded when profiles are involved. It shows the final merged configuration.

Create instances

Container:

incus launch images:debian/13 web-01

VM:

incus launch images:debian/trixie/cloud db-01 --vm

Create without starting:

incus init images:debian/13 test-01
incus start test-01

Lifecycle commands

incus start web-01
incus stop web-01
incus restart web-01
incus pause web-01
incus start web-01
incus delete web-01
incus delete web-01 --force

Prefer a clean stop first:

incus stop web-01 --timeout 60

Use --force only when the instance will not stop or you are deleting a disposable lab.

Shell and exec

incus shell web-01
incus exec web-01 -- bash
incus exec web-01 -- systemctl status nginx
incus exec web-01 -- journalctl -u nginx --no-pager -n 100

For VMs launched from cloud images, wait until cloud-init and the agent are ready:

incus exec db-01 -- cloud-init status --wait

If you see VM agent isn't currently running, wait and retry before assuming the VM failed.

Copy files

Push a file into an instance:

incus file push ./nginx.conf web-01/etc/nginx/nginx.conf

Pull a file out:

incus file pull web-01/etc/nginx/nginx.conf ./nginx.conf

Copy directories recursively:

incus file push -r ./site web-01/var/www/site
incus file pull -r web-01/var/log/nginx ./nginx-logs

Resource limits

incus config set web-01 limits.cpu 2
incus config set web-01 limits.memory 2GiB
incus config unset web-01 limits.memory

Check effective config:

incus config show web-01 --expanded

Environment and metadata

incus config set web-01 user.role web
incus config get web-01 user.role

user.* keys are useful for notes and automation metadata.

Snapshots

Create a snapshot before risky work:

incus snapshot web-01 before-upgrade

List snapshots:

incus info web-01

Rollback:

incus restore web-01 before-upgrade

Delete old snapshot:

incus delete web-01/before-upgrade

Rename, copy, and move

incus copy web-01 web-02
incus move web-02 web-renamed

Move between remotes:

incus copy web-01 other-host:web-01
incus move web-01 other-host:web-01

A good daily workflow

incus list
incus snapshot app-01 before-change
incus shell app-01
incus restart app-01
incus info app-01
incus delete app-01/before-change

Snapshot first, change second, verify third, clean up old snapshots last.