Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

LXD Provider

This guide covers LXD-specific configuration for deploying locally.

Overview

LXD provides lightweight virtual machines that run on your local system. Ideal for development, testing, and CI/CD pipelines.

Why LXD?

  • Zero cloud costs
  • Fast iteration
  • CI/CD friendly (works in GitHub Actions)

Prerequisites

LXD-Specific Configuration

{
  "provider": {
    "provider": "lxd",
    "profile_name": "torrust-profile-local"
  }
}
Field Description Example
provider Must be "lxd" lxd
profile_name LXD profile name (auto-created) torrust-profile-local

LXD-Specific Operations

Check VM Status

lxc list

Direct Console Access

lxc exec torrust-tracker-vm-<environment-name> -- bash

Manual Cleanup

If you need to manually clean up:

# Delete an instance
lxc delete <instance-name> --force

# Delete a profile
lxc profile delete <profile-name>

Troubleshooting

LXD Not Running

# Check LXD status
sudo systemctl status snap.lxd.daemon

# Restart LXD
sudo systemctl restart snap.lxd.daemon

Permission Denied

See the LXD Group Setup section in the LXD tech guide.

Network Issues

# Check network bridge
lxc network list

# Recreate default bridge if needed
lxc network delete lxdbr0
lxc network create lxdbr0

Resource Requirements

Resource Minimum Recommended
RAM 4 GB 8+ GB
CPU 2 cores 4+ cores
Storage 20 GB 50+ GB
OS Linux Ubuntu 22.04+

SSH Key Behavior

Unlike the Hetzner provider, LXD does not create a provider-level SSH key resource. This is because:

  1. Direct console access: lxc exec provides shell access without SSH
  2. No account-level keys: LXD doesn't have an SSH key registry concept
  3. Local environment: No need for remote debugging fallback

SSH access is configured solely through cloud-init for the torrust user.

Debugging without SSH: If cloud-init fails, use direct console access:

lxc exec torrust-tracker-vm-<environment> -- bash

Related Documentation