/
proc
/
self
/
root
/
snap
/
lxd
/
current
/
share
/
lxd-documentation
/
installing
/
File Upload :
llllll
Current File: //proc/self/root/snap/lxd/current/share/lxd-documentation/installing/index.html
<!doctype html> <html class="no-js" lang="en" data-content_root="../"> <head><meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1"/> <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" /> <meta property="og:title" content="How to install LXD" /> <meta property="og:type" content="website" /> <meta property="og:url" content="https://documentation.ubuntu.com/lxd/latest/installing/" /> <meta property="og:site_name" content="LXD documentation" /> <meta property="og:description" content="There are multiple approaches to installing LXD, depending on your Linux distribution, operating system, and use case. Install the LXD snap package: The recommended way to install LXD is its snap p..." /> <meta property="og:image" content="https://documentation.ubuntu.com/lxd/latest/_static/tag.png" /> <meta property="og:image:alt" content="LXD documentation" /> <meta name="description" content="There are multiple approaches to installing LXD, depending on your Linux distribution, operating system, and use case. Install the LXD snap package: The recommended way to install LXD is its snap p..." /> <link rel="index" title="Index" href="../genindex/" /><link rel="search" title="Search" href="../search/" /><link rel="next" title="How to initialize LXD" href="../howto/initialize/" /><link rel="prev" title="Getting started" href="../getting_started/" /> <link rel="canonical" href="https://documentation.ubuntu.com/lxd/installing/" /> <link rel="shortcut icon" href="../_static/favicon.ico"/><!-- Generated with Sphinx 8.2.3 and Furo 2025.07.19 --> <title>How to install LXD</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=d111a655" /> <link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=25af2a20" /> <link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" /> <link rel="stylesheet" type="text/css" href="../_static/youtube.css" /> <link rel="stylesheet" type="text/css" href="../_static/related-links.css" /> <link rel="stylesheet" type="text/css" href="../_static/terminal-output.css" /> <link rel="stylesheet" type="text/css" href="../_static/config-options.css" /> <link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=95c83b7e" /> <link rel="stylesheet" type="text/css" href="../_static/tabs.css?v=a5c4661c" /> <link rel="stylesheet" type="text/css" href="../_static/styles/furo-extensions.css?v=8dab3a3b" /> <link rel="stylesheet" type="text/css" href="../_static/custom.css?v=66d86e9d" /> <link rel="stylesheet" type="text/css" href="../_static/header.css?v=84f70f09" /> <link rel="stylesheet" type="text/css" href="../_static/github_issue_links.css?v=af88fb93" /> <link rel="stylesheet" type="text/css" href="../_static/furo_colors.css?v=c4ccdb8a" /> <link rel="stylesheet" type="text/css" href="../_static/footer.css?v=bd05fc90" /> <link rel="stylesheet" type="text/css" href="../_static/cookie-banner.css?v=b74831ab" /> </head> <body> <header id="header" class="p-navigation"> <script type="module" src="../_static/js/bundle.js"> </script> <!-- Google Tag Manager --> <script> (function(w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); var f = d.getElementsByTagName(s)[0]; var j = d.createElement(s); var dl = ''; if (l != 'dataLayer') { dl = '&l=' + l; } j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', 'GTM-KNX3CJC'); </script> <div class="p-navigation__nav" role="menubar"> <ul class="p-navigation__links" role="menu"> <li> <a class="p-logo" href="https://canonical.com/lxd" aria-current="page"> <img src="../_static/tag.png" alt="Logo" class="p-logo-image"> <div class="p-logo-text p-heading--4">LXD </div> </a> </li> <li class="nav-ubuntu-com"> <a href="https://canonical.com/lxd" class="p-navigation__link">canonical.com/lxd</a> </li> <li> <a href="#" class="p-navigation__link nav-more-links">More resources</a> <ul class="more-links-dropdown"> <li> <a href="https://ubuntu.com/lxd/install/" class="p-navigation__sub-link p-dropdown__link">Install LXD</a> </li> <li> <a href="https://ubuntu.com/lxd/manage/" class="p-navigation__sub-link p-dropdown__link">Manage LXD</a> </li> <li> <a href="https://discourse.ubuntu.com/c/lxd/" class="p-navigation__sub-link p-dropdown__link">Forum</a> </li> <li> <a href="https://github.com/canonical/lxd" class="p-navigation__sub-link p-dropdown__link">GitHub</a> </li> </ul> </li> </ul> </div> </header> <script> document.body.dataset.theme = localStorage.getItem("theme") || "auto"; </script> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-toc" viewBox="0 0 24 24"> <title>Contents</title> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024"> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"> <title>Menu</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu"> <line x1="3" y1="12" x2="21" y2="12"></line> <line x1="3" y1="6" x2="21" y2="6"></line> <line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"> <title>Expand</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right"> <polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-sun" viewBox="0 0 24 24"> <title>Light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather-sun"> <circle cx="12" cy="12" r="5"></circle> <line x1="12" y1="1" x2="12" y2="3"></line> <line x1="12" y1="21" x2="12" y2="23"></line> <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> <line x1="1" y1="12" x2="3" y2="12"></line> <line x1="21" y1="12" x2="23" y2="12"></line> <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> </svg> </symbol> <symbol id="svg-moon" viewBox="0 0 24 24"> <title>Dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" /> </svg> </symbol> <symbol id="svg-sun-with-moon" viewBox="0 0 24 24"> <title>Auto light/dark, in light mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path style="opacity: 50%" d="M 5.411 14.504 C 5.471 14.504 5.532 14.504 5.591 14.504 C 3.639 16.319 4.383 19.569 6.931 20.352 C 7.693 20.586 8.512 20.551 9.25 20.252 C 8.023 23.207 4.056 23.725 2.11 21.184 C 0.166 18.642 1.702 14.949 4.874 14.536 C 5.051 14.512 5.231 14.5 5.411 14.5 L 5.411 14.504 Z"/> <line x1="14.5" y1="3.25" x2="14.5" y2="1.25"/> <line x1="14.5" y1="15.85" x2="14.5" y2="17.85"/> <line x1="10.044" y1="5.094" x2="8.63" y2="3.68"/> <line x1="19" y1="14.05" x2="20.414" y2="15.464"/> <line x1="8.2" y1="9.55" x2="6.2" y2="9.55"/> <line x1="20.8" y1="9.55" x2="22.8" y2="9.55"/> <line x1="10.044" y1="14.006" x2="8.63" y2="15.42"/> <line x1="19" y1="5.05" x2="20.414" y2="3.636"/> <circle cx="14.5" cy="9.55" r="3.6"/> </svg> </symbol> <symbol id="svg-moon-with-sun" viewBox="0 0 24 24"> <title>Auto light/dark, in dark mode</title> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-custom-derived-from-feather-sun-and-tabler-moon"> <path d="M 8.282 7.007 C 8.385 7.007 8.494 7.007 8.595 7.007 C 5.18 10.184 6.481 15.869 10.942 17.24 C 12.275 17.648 13.706 17.589 15 17.066 C 12.851 22.236 5.91 23.143 2.505 18.696 C -0.897 14.249 1.791 7.786 7.342 7.063 C 7.652 7.021 7.965 7 8.282 7 L 8.282 7.007 Z"/> <line style="opacity: 50%" x1="18" y1="3.705" x2="18" y2="2.5"/> <line style="opacity: 50%" x1="18" y1="11.295" x2="18" y2="12.5"/> <line style="opacity: 50%" x1="15.316" y1="4.816" x2="14.464" y2="3.964"/> <line style="opacity: 50%" x1="20.711" y1="10.212" x2="21.563" y2="11.063"/> <line style="opacity: 50%" x1="14.205" y1="7.5" x2="13.001" y2="7.5"/> <line style="opacity: 50%" x1="21.795" y1="7.5" x2="23" y2="7.5"/> <line style="opacity: 50%" x1="15.316" y1="10.184" x2="14.464" y2="11.036"/> <line style="opacity: 50%" x1="20.711" y1="4.789" x2="21.563" y2="3.937"/> <circle style="opacity: 50%" cx="18" cy="7.5" r="2.169"/> </svg> </symbol> <symbol id="svg-pencil" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-pencil-code"> <path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /> <path d="M13.5 6.5l4 4" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> <symbol id="svg-eye" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-eye-code"> <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" /> <path d="M11.11 17.958c-3.209 -.307 -5.91 -2.293 -8.11 -5.958c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6c-.21 .352 -.427 .688 -.647 1.008" /> <path d="M20 21l2 -2l-2 -2" /> <path d="M17 17l-2 2l2 2" /> </svg> </symbol> </svg> <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation"> <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc"> <label class="overlay sidebar-overlay" for="__navigation"> <div class="visually-hidden">Hide navigation sidebar</div> </label> <label class="overlay toc-overlay" for="__toc"> <div class="visually-hidden">Hide table of contents sidebar</div> </label> <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a> <div class="page"> <header class="mobile-header"> <div class="header-left"> <label class="nav-overlay-icon" for="__navigation"> <div class="visually-hidden">Toggle site navigation sidebar</div> <i class="icon"><svg><use href="#svg-menu"></use></svg></i> </label> </div> <div class="header-center"> <a href="../"><div class="brand">LXD</div></a> </div> <div class="header-right"> <div class="theme-toggle-container theme-toggle-header"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-header-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> </header> <aside class="sidebar-drawer"> <div class="sidebar-container"> <div class="sidebar-sticky"><a class="sidebar-brand" href="../"> </a><form class="sidebar-search-container" method="get" action="../search/" role="search"> <input class="sidebar-search" placeholder="Search" name="q" aria-label="Search"> <input type="submit" value="Go"> <input type="hidden" name="check_keywords" value="yes"> <input type="hidden" name="area" value="default"> </form> <div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../">LXD</a></li> <li class="toctree-l1 has-children"><a class="reference internal" href="../tutorial/">Tutorials</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle navigation of Tutorials</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="../tutorial/first_steps/">First steps with LXD</a></li> <li class="toctree-l2"><a class="reference internal" href="../tutorial/ui/">Getting started with the UI</a></li> </ul> </li> <li class="toctree-l1 current has-children"><a class="reference internal" href="../howto/">How-to guides</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle navigation of How-to guides</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l2 current has-children"><a class="reference internal" href="../getting_started/">Getting started</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><div class="visually-hidden">Toggle navigation of Getting started</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul class="current"> <li class="toctree-l3 current current-page"><a class="current reference internal" href="#">Install LXD</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/initialize/">Initialize LXD</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/access_ui/">Access the UI</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/access_documentation/">Access documentation locally</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../operation/">LXD server and client</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><div class="visually-hidden">Toggle navigation of LXD server and client</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/server_expose/">Expose LXD to the network</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/server_configure/">Configure the LXD server</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/oidc_auth0/">Configure OIDC authentication with Auth0</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/oidc_ory/">Configure OIDC authentication with Ory Hydra</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/oidc_keycloak/">Configure OIDC authentication with Keycloak</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/oidc_entra_id/">Configure OIDC authentication with Microsoft Entra ID</a></li> <li class="toctree-l3"><a class="reference internal" href="../remotes/">Add remote servers</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/lxc_alias/">Add command aliases</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../instances/">Instances</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><div class="visually-hidden">Toggle navigation of Instances</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_create/">Create instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_configure/">Configure instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_manage/">Manage instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../profiles/">Use profiles</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_troubleshoot/">Troubleshoot errors</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_ubuntu_pro_attach/">Auto attach Ubuntu Pro</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_access_files/">Access files</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_console/">Access the console</a></li> <li class="toctree-l3"><a class="reference internal" href="../instance-exec/">Run commands</a></li> <li class="toctree-l3"><a class="reference internal" href="../cloud-init/">Use cloud-init</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_routed_nic_vm/">Add a routed NIC to a VM</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_backup/">Back up instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_migrate/">Migrate instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/import_machines_to_instances/">Import existing machines</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/container_gpu_passthrough_with_docker/">Pass NVIDIA GPUs</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../images/">Images</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><div class="visually-hidden">Toggle navigation of Images</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/images_remote/">Use remote images</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/images_manage/">Manage images</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/images_profiles/">Associate profiles</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/images_copy/">Copy and import images</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/images_create/">Create images</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../projects/">Projects</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><div class="visually-hidden">Toggle navigation of Projects</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/projects_create/">Create and configure</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/projects_work/">Work with projects</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/projects_confine/">Confine users to projects</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../storage/">Storage</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><div class="visually-hidden">Toggle navigation of Storage</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_pools/">Manage pools</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_volumes/">Manage volumes</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_buckets/">Manage buckets</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_create_instance/">Create an instance in a pool</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_backup_volume/">Back up a volume</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/storage_move_volume/">Move or copy a volume</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../networks/">Networking</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><div class="visually-hidden">Toggle navigation of Networking</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/network_create/">Create a network</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_configure/">Configure a network</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_bgp/">Configure as BGP server</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_acls/">Configure network ACLs</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_forwards/">Configure forwards</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_zones/">Configure network zones</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_bridge_firewalld/">Configure your firewall</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_bridge_resolved/">Integrate with resolved</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_ovn_setup/">Set up OVN</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_load_balancers/">Configure load balancers</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_ovn_peers/">Configure peer routing</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_ipam/">Display IPAM information</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../clustering/">Clustering</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><div class="visually-hidden">Toggle navigation of Clustering</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_form/">Form a cluster</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_manage/">Manage a cluster</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_config_networks/">Configure networks</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_config_storage/">Configure storage</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_manage_instance/">Manage instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_groups/">Set up cluster groups</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/cluster_recover/">Recover a cluster</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../production-setup/">Production setup</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><div class="visually-hidden">Toggle navigation of Production setup</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/benchmark_performance/">Benchmark performance</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/network_increase_bandwidth/">Increase bandwidth</a></li> <li class="toctree-l3"><a class="reference internal" href="../metrics/">Monitor metrics</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/logs_loki/">Send logs to Loki</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/grafana/">Set up Grafana</a></li> <li class="toctree-l3"><a class="reference internal" href="../backup/">Back up a server</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/disaster_recovery/">Recover instances</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../howto/snap/">Manage the snap</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="../howto/troubleshoot/">Troubleshooting</a><input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><div class="visually-hidden">Toggle navigation of Troubleshooting</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../howto/network_bridge_firewalld/">Configure your firewall</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/instances_troubleshoot/">Troubleshoot instances</a></li> <li class="toctree-l3"><a class="reference internal" href="../howto/dqlite_troubleshoot/">Troubleshoot Dqlite</a></li> <li class="toctree-l3"><a class="reference internal" href="../debugging/">Debug LXD</a></li> <li class="toctree-l3"><a class="reference internal" href="../faq/">Frequently asked</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../support/">Get support</a></li> <li class="toctree-l2"><a class="reference internal" href="../contributing/">Contribute to LXD</a></li> </ul> </li> <li class="toctree-l1 has-children"><a class="reference internal" href="../explanation/">Explanation</a><input class="toctree-checkbox" id="toctree-checkbox-13" name="toctree-checkbox-13" role="switch" type="checkbox"/><label for="toctree-checkbox-13"><div class="visually-hidden">Toggle navigation of Explanation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="../explanation/lxd_lxc/"><code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/instances/">Containers and VMs</a></li> <li class="toctree-l2"><a class="reference internal" href="../image-handling/">Local and remote images</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/storage/">Storage pools, volumes, and buckets</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/networks/">Networking setups</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/">The LXD Dqlite database</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/lxc_show_info/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code> <code class="docutils literal notranslate"><span class="pre">show</span></code> and <code class="docutils literal notranslate"><span class="pre">info</span></code></a></li> <li class="toctree-l2"><a class="reference internal" href="../authentication/">Remote API authentication</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/authorization/">Remote API authorization</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/projects/">Instances grouping with projects</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/clusters/">Clusters</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/performance_tuning/">Performance tuning</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/security/">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="../explanation/bpf/">Privilege delegation using BPF Token</a></li> </ul> </li> <li class="toctree-l1 has-children"><a class="reference internal" href="../reference/">Reference</a><input class="toctree-checkbox" id="toctree-checkbox-14" name="toctree-checkbox-14" role="switch" type="checkbox"/><label for="toctree-checkbox-14"><div class="visually-hidden">Toggle navigation of Reference</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l2"><a class="reference internal" href="../requirements/">Requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="../architectures/">Architectures</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/releases-snap/">Releases and snap</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/remote_image_servers/">Remote image servers</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/image_format/">Image format</a></li> <li class="toctree-l2"><a class="reference internal" href="../guest-os-compatibility/">Guest OS compatibility</a></li> <li class="toctree-l2"><a class="reference internal" href="../container-environment/">Container environment</a></li> <li class="toctree-l2"><a class="reference internal" href="../config-options/">Configuration option index</a></li> <li class="toctree-l2"><a class="reference internal" href="../server/">Server configuration</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="../explanation/instance_config/">Instance configuration</a><input class="toctree-checkbox" id="toctree-checkbox-15" name="toctree-checkbox-15" role="switch" type="checkbox"/><label for="toctree-checkbox-15"><div class="visually-hidden">Toggle navigation of Instance configuration</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../reference/instance_properties/">Instance properties</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/instance_options/">Instance options</a></li> <li class="toctree-l3 has-children"><a class="reference internal" href="../reference/devices/">Devices</a><input class="toctree-checkbox" id="toctree-checkbox-16" name="toctree-checkbox-16" role="switch" type="checkbox"/><label for="toctree-checkbox-16"><div class="visually-hidden">Toggle navigation of Devices</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l4"><a class="reference internal" href="../reference/standard_devices/">Standard devices</a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_none/">Type: <code class="docutils literal notranslate"><span class="pre">none</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_nic/">Type: <code class="docutils literal notranslate"><span class="pre">nic</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_disk/">Type: <code class="docutils literal notranslate"><span class="pre">disk</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_unix_char/">Type: <code class="docutils literal notranslate"><span class="pre">unix-char</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_unix_block/">Type: <code class="docutils literal notranslate"><span class="pre">unix-block</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_usb/">Type: <code class="docutils literal notranslate"><span class="pre">usb</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_gpu/">Type: <code class="docutils literal notranslate"><span class="pre">gpu</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_infiniband/">Type: <code class="docutils literal notranslate"><span class="pre">infiniband</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_proxy/">Type: <code class="docutils literal notranslate"><span class="pre">proxy</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_unix_hotplug/">Type: <code class="docutils literal notranslate"><span class="pre">unix-hotplug</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_tpm/">Type: <code class="docutils literal notranslate"><span class="pre">tpm</span></code></a></li> <li class="toctree-l4"><a class="reference internal" href="../reference/devices_pci/">Type: <code class="docutils literal notranslate"><span class="pre">pci</span></code></a></li> </ul> </li> <li class="toctree-l3"><a class="reference internal" href="../reference/instance_units/">Units for storage and network limits</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../reference/preseed_yaml_fields/">Preseed YAML file fields</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/projects/">Project configuration</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="../reference/storage_drivers/">Storage drivers</a><input class="toctree-checkbox" id="toctree-checkbox-17" name="toctree-checkbox-17" role="switch" type="checkbox"/><label for="toctree-checkbox-17"><div class="visually-hidden">Toggle navigation of Storage drivers</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_btrfs/">Btrfs - <code class="docutils literal notranslate"><span class="pre">btrfs</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_cephfs/">CephFS - <code class="docutils literal notranslate"><span class="pre">cephfs</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_cephobject/">Ceph Object - <code class="docutils literal notranslate"><span class="pre">cephobject</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_ceph/">Ceph RBD - <code class="docutils literal notranslate"><span class="pre">ceph</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_powerflex/">Dell PowerFlex - <code class="docutils literal notranslate"><span class="pre">powerflex</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_pure/">Pure Storage - <code class="docutils literal notranslate"><span class="pre">pure</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_dir/">Directory - <code class="docutils literal notranslate"><span class="pre">dir</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_lvm/">LVM - <code class="docutils literal notranslate"><span class="pre">lvm</span></code></a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/storage_zfs/">ZFS - <code class="docutils literal notranslate"><span class="pre">zfs</span></code></a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../reference/networks/">Networks</a><input class="toctree-checkbox" id="toctree-checkbox-18" name="toctree-checkbox-18" role="switch" type="checkbox"/><label for="toctree-checkbox-18"><div class="visually-hidden">Toggle navigation of Networks</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../reference/network_bridge/">Bridge network</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/network_ovn/">OVN network</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/network_macvlan/">Macvlan network</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/network_physical/">Physical network</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/network_sriov/">SR-IOV network</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../reference/cluster_member_config/">Cluster configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/server_settings/">Production server settings</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/provided_metrics/">Provided metrics</a></li> <li class="toctree-l2"><a class="reference internal" href="../reference/permissions/">Permissions</a></li> <li class="toctree-l2 has-children"><a class="reference internal" href="../restapi_landing/">REST API</a><input class="toctree-checkbox" id="toctree-checkbox-19" name="toctree-checkbox-19" role="switch" type="checkbox"/><label for="toctree-checkbox-19"><div class="visually-hidden">Toggle navigation of REST API</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../rest-api/">Main API documentation</a></li> <li class="toctree-l3"><a class="reference internal" href="../api/">Main API specification</a></li> <li class="toctree-l3"><a class="reference internal" href="../api-extensions/">Main API extensions</a></li> <li class="toctree-l3"><a class="reference internal" href="../events/">Events API documentation</a></li> <li class="toctree-l3"><a class="reference internal" href="../dev-lxd/">Instance API</a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../reference/manpages/">Man pages</a><input class="toctree-checkbox" id="toctree-checkbox-20" name="toctree-checkbox-20" role="switch" type="checkbox"/><label for="toctree-checkbox-20"><div class="visually-hidden">Toggle navigation of Man pages</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../reference/manpages/lxc/"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></a></li> </ul> </li> <li class="toctree-l2 has-children"><a class="reference internal" href="../internals/">Internals</a><input class="toctree-checkbox" id="toctree-checkbox-21" name="toctree-checkbox-21" role="switch" type="checkbox"/><label for="toctree-checkbox-21"><div class="visually-hidden">Toggle navigation of Internals</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul> <li class="toctree-l3"><a class="reference internal" href="../environment/">Environment variables</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/uefi_variables/">UEFI variables for VMs</a></li> <li class="toctree-l3"><a class="reference internal" href="../daemon-behavior/">Daemon behavior</a></li> <li class="toctree-l3"><a class="reference internal" href="../syscall-interception/">System call interception</a></li> <li class="toctree-l3"><a class="reference internal" href="../userns-idmap/">User namespace setup</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/ovn-internals/">OVN implementation</a></li> <li class="toctree-l3"><a class="reference internal" href="../reference/vm_live_migration_internals/">VM live migration implementation</a></li> </ul> </li> <li class="toctree-l2"><a class="reference external" href="https://github.com/canonical/lxd">Project repository</a></li> <li class="toctree-l2"><a class="reference external" href="https://images.lxd.canonical.com">Image server</a></li> </ul> </li> </ul> </div> </div> </div> </div> </aside> <div class="main"> <div class="content"> <div class="article-container"> <a href="#" class="back-to-top muted-link"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path> </svg> <span>Back to top</span> </a> <div class="content-icon-container"> <div class="view-this-page"> <a class="muted-link" href="../_sources/installing.md.txt" title="View this page"> <svg><use href="#svg-eye"></use></svg> <span class="visually-hidden">View this page</span> </a> </div> <div class="theme-toggle-container theme-toggle-content"> <button class="theme-toggle"> <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div> <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg> <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg> <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg> <svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg> </button> </div> <label class="toc-overlay-icon toc-content-icon" for="__toc"> <div class="visually-hidden">Toggle table of contents sidebar</div> <i class="icon"><svg><use href="#svg-toc"></use></svg></i> </label> </div> <article role="main" id="furo-main-content"> <section id="how-to-install-lxd"> <span id="installing"></span><h1>How to install LXD<a class="headerlink" href="#how-to-install-lxd" title="Link to this heading">¶</a></h1> <p>There are multiple approaches to installing LXD, depending on your Linux distribution, operating system, and use case.</p> <section id="install-the-lxd-snap-package"> <span id="installing-snap-package"></span><h2>Install the LXD snap package<a class="headerlink" href="#install-the-lxd-snap-package" title="Link to this heading">¶</a></h2> <p>The recommended way to install LXD is its <a class="reference external" href="https://snapcraft.io/lxd">snap package</a>, available for many Linux distributions. For alternative methods, see: <a class="reference internal" href="#installing-other"><span class="std std-ref">Other Linux installation options</span></a>, <a class="reference internal" href="#installing-other-os"><span class="std std-ref">Other operating systems</span></a>, or <a class="reference internal" href="#installing-from-source"><span class="std std-ref">Install LXD from source</span></a>.</p> <section id="requirements"> <h3>Requirements<a class="headerlink" href="#requirements" title="Link to this heading">¶</a></h3> <ul class="simple"> <li><p>The LXD snap must be <a class="reference external" href="https://snapcraft.io/lxd#distros">available for your Linux distribution</a>.</p></li> <li><p>The <a class="reference external" href="https://snapcraft.io/docs/installing-snapd"><code class="docutils literal notranslate"><span class="pre">snapd</span></code> daemon</a> must be installed.</p></li> </ul> </section> <section id="install"> <h3>Install<a class="headerlink" href="#install" title="Link to this heading">¶</a></h3> <p>Use this command to install LXD from the recommended <a class="reference internal" href="../reference/releases-snap/#ref-snap-tracks-default"><span class="std std-ref">default snap track</span></a> (currently 5.21):</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>lxd </pre></div> </div> <p>If you are installing LXD on a <a class="reference internal" href="../explanation/clusters/#exp-clusters"><span class="std std-ref">cluster member</span></a>, add the <code class="docutils literal notranslate"><span class="pre">--cohort="+"</span></code> flag to <a class="reference internal" href="../howto/snap/#howto-snap-updates-sync"><span class="std std-ref">keep cluster members synchronized</span></a> to the same snap version:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>lxd<span class="w"> </span>--cohort<span class="o">=</span><span class="s2">"+"</span> </pre></div> </div> <p>Next, follow the <a class="reference internal" href="#installing-snap-post"><span class="std std-ref">Post-installation</span></a> steps below.</p> <section id="optionally-specify-a-channel"> <span id="installing-snap-channel"></span><h4>Optionally specify a channel<a class="headerlink" href="#optionally-specify-a-channel" title="Link to this heading">¶</a></h4> <p>Channels correspond to different <a class="reference internal" href="../reference/releases-snap/#ref-releases"><span class="std std-ref">LXD releases</span></a>. When unspecified, the LXD snap defaults to the most recent <code class="docutils literal notranslate"><span class="pre">stable</span></code> LTS, which is recommended for most use cases.</p> <p>To specify a different channel, add the <code class="docutils literal notranslate"><span class="pre">--channel</span></code> flag at installation:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>lxd<span class="w"> </span>--channel<span class="o">=</span><target<span class="w"> </span>channel><span class="w"> </span><span class="o">[</span>--cohort<span class="o">=</span><span class="s2">"+"</span><span class="o">]</span> </pre></div> </div> <p>For example, to use the <code class="docutils literal notranslate"><span class="pre">6/stable</span></code> channel, run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>lxd<span class="w"> </span>--channel<span class="o">=</span><span class="m">6</span>/stable </pre></div> </div> <p>For details about LXD snap channels, see: <a class="reference internal" href="../reference/releases-snap/#ref-snap-channels"><span class="std std-ref">Channels</span></a>.</p> </section> </section> <section id="post-installation"> <span id="installing-snap-post"></span><h3>Post-installation<a class="headerlink" href="#post-installation" title="Link to this heading">¶</a></h3> <p>Follow these steps after installing the LXD snap.</p> <section id="add-the-current-user"> <span id="installing-snap-user"></span><h4>Add the current user<a class="headerlink" href="#add-the-current-user" title="Link to this heading">¶</a></h4> <p>To allow the current user to interact with the LXD daemon, update the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>getent<span class="w"> </span>group<span class="w"> </span>lxd<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>-qwF<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span><span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>usermod<span class="w"> </span>-aG<span class="w"> </span>lxd<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span> </pre></div> </div> <!-- Include start newgrp --> <p>Afterward, apply the change to your current shell session by running:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>newgrp<span class="w"> </span>lxd </pre></div> </div> <!-- Include end newgrp --> <p>For more information, see the <a class="reference internal" href="#installing-manage-access"><span class="std std-ref">Manage access to LXD</span></a> section below.</p> </section> <section id="hold-or-schedule-updates"> <span id="installing-snap-hold-updates"></span><h4>Hold or schedule updates<a class="headerlink" href="#hold-or-schedule-updates" title="Link to this heading">¶</a></h4> <p>When a new release is published to a snap channel, installed snaps following that channel update automatically by default.</p> <p>For <a class="reference internal" href="../explanation/clusters/#exp-clusters"><span class="std std-ref">LXD clusters</span></a>, or on any machine where you want control over updates, you should override this default behavior by either holding or scheduling updates. See: <a class="reference internal" href="../howto/snap/#howto-snap-updates"><span class="std std-ref">Manage updates</span></a>.</p> </section> </section> </section> <section id="other-linux-installation-options"> <span id="installing-other"></span><h2>Other Linux installation options<a class="headerlink" href="#other-linux-installation-options" title="Link to this heading">¶</a></h2> <p>Some Linux installations can use package managers other than Snap to install LXD. These managers all install the latest <a class="reference internal" href="../reference/releases-snap/#ref-releases-feature"><span class="std std-ref">feature release</span></a>.</p> <div class="sphinx-tabs docutils container"> <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-QWxwaW5lIExpbnV4" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-0-QWxwaW5lIExpbnV4" name="QWxwaW5lIExpbnV4" role="tab" tabindex="0">Alpine Linux</button><button aria-controls="panel-0-QXJjaCBMaW51eA==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tab" tabindex="-1">Arch Linux</button><button aria-controls="panel-0-RmVkb3Jh" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-RmVkb3Jh" name="RmVkb3Jh" role="tab" tabindex="-1">Fedora</button><button aria-controls="panel-0-R2VudG9v" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-R2VudG9v" name="R2VudG9v" role="tab" tabindex="-1">Gentoo</button></div><div aria-labelledby="tab-0-QWxwaW5lIExpbnV4" class="sphinx-tabs-panel group-tab" id="panel-0-QWxwaW5lIExpbnV4" name="QWxwaW5lIExpbnV4" role="tabpanel" tabindex="0"><p>Run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apk<span class="w"> </span>add<span class="w"> </span>lxd </pre></div> </div> </div><div aria-labelledby="tab-0-QXJjaCBMaW51eA==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tabpanel" tabindex="0"><p>Run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman<span class="w"> </span>-S<span class="w"> </span>lxd </pre></div> </div> </div><div aria-labelledby="tab-0-RmVkb3Jh" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-RmVkb3Jh" name="RmVkb3Jh" role="tabpanel" tabindex="0"><p>Fedora RPM packages for LXC/LXD are available in the <a class="reference external" href="https://copr.fedorainfracloud.org/coprs/ganto/lxc4/">COPR repository</a>. These are unofficial and minimally tested; use at your own risk.</p> <p>View the <a class="reference external" href="https://github.com/ganto/copr-lxc4/wiki">installation guide</a> for details.</p> </div><div aria-labelledby="tab-0-R2VudG9v" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-R2VudG9v" name="R2VudG9v" role="tabpanel" tabindex="0"><p>Run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>emerge<span class="w"> </span>--ask<span class="w"> </span>lxd </pre></div> </div> </div></div> <p>Following installation, make sure to <a class="reference internal" href="#installing-manage-access"><span class="std std-ref">manage access to LXD</span></a>.</p> </section> <section id="other-operating-systems"> <span id="installing-other-os"></span><h2>Other operating systems<a class="headerlink" href="#other-operating-systems" title="Link to this heading">¶</a></h2> <p>Builds of the <a class="reference internal" href="../reference/manpages/lxc/#lxc-md"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></span></a> client are available for non-Linux operating systems to enable interaction with remote LXD servers. For more information, see: <a class="reference internal" href="../explanation/lxd_lxc/#lxd-lxc"><span class="std std-ref">About <code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code></span></a>.</p> <div class="sphinx-tabs docutils container"> <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-bWFjT1M=" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-1-bWFjT1M=" name="bWFjT1M=" role="tab" tabindex="0">macOS</button><button aria-controls="panel-1-V2luZG93cw==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-1-V2luZG93cw==" name="V2luZG93cw==" role="tab" tabindex="-1">Windows</button></div><div aria-labelledby="tab-1-bWFjT1M=" class="sphinx-tabs-panel group-tab" id="panel-1-bWFjT1M=" name="bWFjT1M=" role="tabpanel" tabindex="0"><p>The <a class="reference external" href="https://brew.sh">Homebrew</a> package manager must be installed on your system.</p> <p>To install the client from the latest <a class="reference internal" href="../reference/releases-snap/#ref-releases-feature"><span class="std std-ref">feature release</span></a> of LXD, run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>brew<span class="w"> </span>install<span class="w"> </span>lxc </pre></div> </div> </div><div aria-labelledby="tab-1-V2luZG93cw==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-1-V2luZG93cw==" name="V2luZG93cw==" role="tabpanel" tabindex="0"><p>The <a class="reference external" href="https://chocolatey.org">Chocolatey</a> package manager must be installed on your system.</p> <p>To install the client from the latest <a class="reference internal" href="../reference/releases-snap/#ref-releases-feature"><span class="std std-ref">feature release</span></a> of LXD, run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>choco<span class="w"> </span>install<span class="w"> </span>lxc </pre></div> </div> </div></div> </section> <section id="native-builds-of-the-client"> <span id="installing-native"></span><h2>Native builds of the client<a class="headerlink" href="#native-builds-of-the-client" title="Link to this heading">¶</a></h2> <p>You can find native builds of the <a class="reference internal" href="../reference/manpages/lxc/#lxc-md"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></span></a> client on <a class="reference external" href="https://github.com/canonical/lxd">GitHub</a>:</p> <ul class="simple"> <li><p>Linux: <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.linux.lxc.aarch64"><code class="docutils literal notranslate"><span class="pre">bin.linux.lxc.aarch64</span></code></a>, <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.linux.lxc.x86_64"><code class="docutils literal notranslate"><span class="pre">bin.linux.lxc.x86_64</span></code></a></p></li> <li><p>Windows: <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.windows.lxc.aarch64.exe"><code class="docutils literal notranslate"><span class="pre">bin.windows.lxc.aarch64.exe</span></code></a>, <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.windows.lxc.x86_64.exe"><code class="docutils literal notranslate"><span class="pre">bin.windows.lxc.x86_64.exe</span></code></a></p></li> <li><p>macOS: <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.macos.lxc.aarch64"><code class="docutils literal notranslate"><span class="pre">bin.macos.lxc.aarch64</span></code></a>, <a class="reference external" href="https://github.com/canonical/lxd/releases/latest/download/bin.macos.lxc.x86_64"><code class="docutils literal notranslate"><span class="pre">bin.macos.lxc.x86_64</span></code></a></p></li> </ul> <p>To download a specific build:</p> <ol class="arabic simple"> <li><p>Make sure that you are logged into your GitHub account.</p></li> <li><p>Filter for the branch or tag that you are interested in (for example, the latest release tag or <code class="docutils literal notranslate"><span class="pre">main</span></code>).</p></li> <li><p>Select the latest build and download the suitable artifact.</p></li> </ol> <p>These builds are for the <a class="reference internal" href="../reference/manpages/lxc/#lxc-md"><span class="std std-ref"><code class="docutils literal notranslate"><span class="pre">lxc</span></code></span></a> client only, not the LXD daemon. For an explanation of the differences, see: <a class="reference internal" href="../explanation/lxd_lxc/#lxd-lxc"><span class="std std-ref">About <code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code></span></a>.</p> </section> <section id="install-lxd-from-source"> <span id="id1"></span><span id="installing-from-source"></span><h2>Install LXD from source<a class="headerlink" href="#install-lxd-from-source" title="Link to this heading">¶</a></h2> <p>These instructions for building and installing from source are suitable for developers who want to build the latest version of LXD, or to build a specific release of LXD which may not be offered by their Linux distribution. Source builds for integration into Linux distributions are not covered.</p> <p>We recommend having the latest versions of <code class="docutils literal notranslate"><span class="pre">liblxc</span></code> (see <a class="reference internal" href="../requirements/#requirements-lxc"><span class="std std-ref">LXC requirements</span></a>) available for LXD development. For convenience, <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code> will pull the appropriate versions of <code class="docutils literal notranslate"><span class="pre">liblxc</span></code> and <code class="docutils literal notranslate"><span class="pre">dqlite</span></code> from their corresponding upstream Git repository. Additionally, LXD requires a modern Golang (see <a class="reference internal" href="../requirements/#requirements-go"><span class="std std-ref">Go</span></a>) version to work. On Ubuntu, you can install these with:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>apt<span class="w"> </span>update sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span><span class="se">\</span> <span class="w"> </span>autoconf<span class="w"> </span><span class="se">\</span> <span class="w"> </span>automake<span class="w"> </span><span class="se">\</span> <span class="w"> </span>build-essential<span class="w"> </span><span class="se">\</span> <span class="w"> </span>gettext<span class="w"> </span><span class="se">\</span> <span class="w"> </span>git<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libacl1-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libapparmor-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libcap-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>liblz4-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libseccomp-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libsqlite3-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libtool<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libudev-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>libuv1-dev<span class="w"> </span><span class="se">\</span> <span class="w"> </span>make<span class="w"> </span><span class="se">\</span> <span class="w"> </span>meson<span class="w"> </span><span class="se">\</span> <span class="w"> </span>ninja-build<span class="w"> </span><span class="se">\</span> <span class="w"> </span>pkg-config<span class="w"> </span><span class="se">\</span> <span class="w"> </span>python3-venv <span class="nb">command</span><span class="w"> </span>-v<span class="w"> </span>snap<span class="w"> </span>>/dev/null<span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>snapd sudo<span class="w"> </span>snap<span class="w"> </span>install<span class="w"> </span>--classic<span class="w"> </span>go </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>If you use the <code class="docutils literal notranslate"><span class="pre">liblxc-dev</span></code> package and get compile time errors when building the <code class="docutils literal notranslate"><span class="pre">go-lxc</span></code> module, ensure that the value for <code class="docutils literal notranslate"><span class="pre">LXC_DEVEL</span></code> is <code class="docutils literal notranslate"><span class="pre">0</span></code> for your <code class="docutils literal notranslate"><span class="pre">liblxc</span></code> build. To check this, look at <code class="docutils literal notranslate"><span class="pre">/usr/include/lxc/version.h</span></code>. If the <code class="docutils literal notranslate"><span class="pre">LXC_DEVEL</span></code> value is <code class="docutils literal notranslate"><span class="pre">1</span></code>, replace it with <code class="docutils literal notranslate"><span class="pre">0</span></code> to work around the problem. It’s a packaging bug that is now fixed, see <a class="reference external" href="https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/2039873">LP: #2039873</a>.</p> </div> <p>There are a few storage drivers for LXD besides the default <code class="docutils literal notranslate"><span class="pre">dir</span></code> driver. Installing these tools adds a bit to <code class="docutils literal notranslate"><span class="pre">initramfs</span></code> and may slow down your host boot, but are needed if you’d like to use a particular driver:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>lvm2<span class="w"> </span>thin-provisioning-tools sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>btrfs-progs </pre></div> </div> <p>At runtime, LXD might need the following packages to be installed on the host system:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>apt<span class="w"> </span>update sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span><span class="se">\</span> <span class="w"> </span>attr<span class="w"> </span><span class="se">\</span> <span class="w"> </span>iproute2<span class="w"> </span><span class="se">\</span> <span class="w"> </span>nftables<span class="w"> </span><span class="se">\</span> <span class="w"> </span>rsync<span class="w"> </span><span class="se">\</span> <span class="w"> </span>squashfs-tools<span class="w"> </span><span class="se">\</span> <span class="w"> </span>tar<span class="w"> </span><span class="se">\</span> <span class="w"> </span>xz-utils <span class="c1"># `nftables` can be replaced by `iptables` on older systems</span> </pre></div> </div> <p>To run the test suite or test related <code class="docutils literal notranslate"><span class="pre">make</span></code> targets, you’ll also need:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>apt<span class="w"> </span>update sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span><span class="se">\</span> <span class="w"> </span>acl<span class="w"> </span><span class="se">\</span> <span class="w"> </span>bind9-dnsutils<span class="w"> </span><span class="se">\</span> <span class="w"> </span>btrfs-progs<span class="w"> </span><span class="se">\</span> <span class="w"> </span>busybox-static<span class="w"> </span><span class="se">\</span> <span class="w"> </span>curl<span class="w"> </span><span class="se">\</span> <span class="w"> </span>dnsmasq-base<span class="w"> </span><span class="se">\</span> <span class="w"> </span>dosfstools<span class="w"> </span><span class="se">\</span> <span class="w"> </span>e2fsprogs<span class="w"> </span><span class="se">\</span> <span class="w"> </span>iputils-ping<span class="w"> </span><span class="se">\</span> <span class="w"> </span>jq<span class="w"> </span><span class="se">\</span> <span class="w"> </span>netcat-openbsd<span class="w"> </span><span class="se">\</span> <span class="w"> </span>openvswitch-switch<span class="w"> </span><span class="se">\</span> <span class="w"> </span>s3cmd<span class="w"> </span><span class="se">\</span> <span class="w"> </span>shellcheck<span class="w"> </span><span class="se">\</span> <span class="w"> </span>socat<span class="w"> </span><span class="se">\</span> <span class="w"> </span>sqlite3<span class="w"> </span><span class="se">\</span> <span class="w"> </span>swtpm<span class="w"> </span><span class="se">\</span> <span class="w"> </span>xfsprogs<span class="w"> </span><span class="se">\</span> <span class="w"> </span>yq </pre></div> </div> <section id="from-source-build-the-latest-version"> <h3>From source: Build the latest version<a class="headerlink" href="#from-source-build-the-latest-version" title="Link to this heading">¶</a></h3> <p>These instructions for building from source are suitable for individual developers who want to build the latest version of LXD, or build a specific release of LXD which may not be offered by their Linux distribution. Source builds for integration into Linux distributions are not covered here and may be covered in detail in a separate document in the future.</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/canonical/lxd <span class="nb">cd</span><span class="w"> </span>lxd </pre></div> </div> <p>This will download the current development tree of LXD and place you in the source tree. Then proceed to the instructions below to actually build and install LXD.</p> </section> <section id="from-source-build-a-release"> <h3>From source: Build a release<a class="headerlink" href="#from-source-build-a-release" title="Link to this heading">¶</a></h3> <p>The LXD release tarballs bundle a complete dependency tree as well as a local copy <code class="docutils literal notranslate"><span class="pre">libdqlite</span></code> for LXD’s database setup.</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>tar<span class="w"> </span>zxvf<span class="w"> </span>lxd-4.18.tar.gz <span class="nb">cd</span><span class="w"> </span>lxd-4.18 </pre></div> </div> <p>This will unpack the release tarball and place you inside of the source tree. Then proceed to the instructions below to actually build and install LXD.</p> </section> <section id="start-the-build"> <h3>Start the build<a class="headerlink" href="#start-the-build" title="Link to this heading">¶</a></h3> <p>The actual building is done by two separate invocations of the Makefile: <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code> – which builds libraries required by LXD – and <code class="docutils literal notranslate"><span class="pre">make</span></code>, which builds LXD itself. At the end of <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code>, a message will be displayed which will specify environment variables that should be set prior to invoking <code class="docutils literal notranslate"><span class="pre">make</span></code>. As new versions of LXD are released, these environment variable settings may change, so be sure to use the ones displayed at the end of the <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code> process, as the ones below (shown for example purposes) may not exactly match what your version of LXD requires:</p> <p>We recommend having at least 2GiB of RAM to allow the build to complete.</p> <div class="terminal docutils container"> <div class="input docutils container"> <code class="prompt docutils literal notranslate"><span class="pre">~$</span> </code><code class="command docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code></div> <code class="output docutils literal notranslate"><span class="pre">...</span></code><code class="output docutils literal notranslate"><span class="pre">make[1]:</span> <span class="pre">Leaving</span> <span class="pre">directory</span> <span class="pre">'/root/go/deps/dqlite'</span></code><code class="output docutils literal notranslate"><span class="pre">#</span> <span class="pre">environment</span></code><code class="output docutils literal notranslate"> </code><code class="output docutils literal notranslate"><span class="pre">Please</span> <span class="pre">set</span> <span class="pre">the</span> <span class="pre">following</span> <span class="pre">in</span> <span class="pre">your</span> <span class="pre">environment</span> <span class="pre">(possibly</span> <span class="pre">~/.bashrc)</span></code><code class="output docutils literal notranslate"><span class="pre">#</span>  <span class="pre">export</span> <span class="pre">CGO_CFLAGS="${CGO_CFLAGS}</span> <span class="pre">-I$(go</span> <span class="pre">env</span> <span class="pre">GOPATH)/deps/dqlite/include/"</span></code><code class="output docutils literal notranslate"><span class="pre">#</span>  <span class="pre">export</span> <span class="pre">CGO_LDFLAGS="${CGO_LDFLAGS}</span> <span class="pre">-L$(go</span> <span class="pre">env</span> <span class="pre">GOPATH)/deps/dqlite/.libs/"</span></code><code class="output docutils literal notranslate"><span class="pre">#</span>  <span class="pre">export</span> <span class="pre">LD_LIBRARY_PATH="$(go</span> <span class="pre">env</span> <span class="pre">GOPATH)/deps/dqlite/.libs/${LD_LIBRARY_PATH}"</span></code><code class="output docutils literal notranslate"><span class="pre">#</span>  <span class="pre">export</span> <span class="pre">CGO_LDFLAGS_ALLOW="(-Wl,-wrap,pthread_create)|(-Wl,-z,now)"</span></code><div class="input docutils container"> <code class="prompt docutils literal notranslate"><span class="pre">~$</span> </code><code class="command docutils literal notranslate"><span class="pre">make</span></code></div> </div> </section> <section id="from-source-install"> <h3>From source: Install<a class="headerlink" href="#from-source-install" title="Link to this heading">¶</a></h3> <p>Once the build completes, you simply keep the source tree, add the directory referenced by <code class="docutils literal notranslate"><span class="pre">$(go</span> <span class="pre">env</span> <span class="pre">GOPATH)/bin</span></code> to your shell path, and set the <code class="docutils literal notranslate"><span class="pre">LD_LIBRARY_PATH</span></code> variable printed by <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">deps</span></code> to your environment. This might look something like this for a <code class="docutils literal notranslate"><span class="pre">~/.bashrc</span></code> file:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="si">${</span><span class="nv">PATH</span><span class="si">}</span><span class="s2">:</span><span class="k">$(</span>go<span class="w"> </span>env<span class="w"> </span>GOPATH<span class="k">)</span><span class="s2">/bin"</span> <span class="nb">export</span><span class="w"> </span><span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="s2">"</span><span class="k">$(</span>go<span class="w"> </span>env<span class="w"> </span>GOPATH<span class="k">)</span><span class="s2">/deps/dqlite/.libs/:</span><span class="si">${</span><span class="nv">LD_LIBRARY_PATH</span><span class="si">}</span><span class="s2">"</span> </pre></div> </div> <p>Now, the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> and <code class="docutils literal notranslate"><span class="pre">lxc</span></code> binaries will be available to you and can be used to set up LXD. The binaries will automatically find and use the dependencies built in <code class="docutils literal notranslate"><span class="pre">$(go</span> <span class="pre">env</span> <span class="pre">GOPATH)/deps</span></code> thanks to the <code class="docutils literal notranslate"><span class="pre">LD_LIBRARY_PATH</span></code> environment variable.</p> </section> <section id="machine-setup"> <h3>Machine setup<a class="headerlink" href="#machine-setup" title="Link to this heading">¶</a></h3> <p>You’ll need sub{u,g}ids for root, so that LXD can create the unprivileged containers:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="s2">"root:1000000:1000000000"</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>sudo<span class="w"> </span>tee<span class="w"> </span>-a<span class="w"> </span>/etc/subuid<span class="w"> </span>/etc/subgid </pre></div> </div> <p>By default, only users added to the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group can interact with the LXD daemon. Installing from source doesn’t guarantee that the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group exists in the system. If you want the current user (or any other user) to be able to interact with the LXD daemon, create the group and add the user to it:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>getent<span class="w"> </span>group<span class="w"> </span>lxd<span class="w"> </span>>/dev/null<span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>groupadd<span class="w"> </span>--system<span class="w"> </span>lxd<span class="w"> </span><span class="c1"># create the group if needed</span> getent<span class="w"> </span>group<span class="w"> </span>lxd<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>-qwF<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span><span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>usermod<span class="w"> </span>-aG<span class="w"> </span>lxd<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span> </pre></div> </div> <p>Afterward, apply the change to your current shell session by running:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>newgrp<span class="w"> </span>lxd </pre></div> </div> <p>Now you can run the daemon (the <code class="docutils literal notranslate"><span class="pre">--group</span> <span class="pre">sudo</span></code> bit allows everyone in the <code class="docutils literal notranslate"><span class="pre">sudo</span></code> group to talk to LXD; you can create your own group if you want):</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>-E<span class="w"> </span><span class="nv">PATH</span><span class="o">=</span><span class="si">${</span><span class="nv">PATH</span><span class="si">}</span><span class="w"> </span><span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="si">${</span><span class="nv">LD_LIBRARY_PATH</span><span class="si">}</span><span class="w"> </span><span class="k">$(</span>go<span class="w"> </span>env<span class="w"> </span>GOPATH<span class="k">)</span>/bin/lxd<span class="w"> </span>--group<span class="w"> </span>sudo </pre></div> </div> <div class="admonition note"> <p class="admonition-title">Note</p> <p>If <code class="docutils literal notranslate"><span class="pre">newuidmap/newgidmap</span></code> tools are present on your system and <code class="docutils literal notranslate"><span class="pre">/etc/subuid</span></code>, <code class="docutils literal notranslate"><span class="pre">etc/subgid</span></code> exist, they must be configured to allow the root user a contiguous range of at least 10M UID/GID.</p> </div> </section> <section id="shell-completions"> <h3>Shell completions<a class="headerlink" href="#shell-completions" title="Link to this heading">¶</a></h3> <p>Shell completion profiles can be generated with <code class="docutils literal notranslate"><span class="pre">lxc</span> <span class="pre">completion</span> <span class="pre"><shell></span></code> (e.g. <code class="docutils literal notranslate"><span class="pre">lxc</span> <span class="pre">completion</span> <span class="pre">bash</span></code>). Supported shells are <code class="docutils literal notranslate"><span class="pre">bash</span></code>, <code class="docutils literal notranslate"><span class="pre">zsh</span></code>, <code class="docutils literal notranslate"><span class="pre">fish</span></code>, and <code class="docutils literal notranslate"><span class="pre">powershell</span></code>.</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>lxc<span class="w"> </span>completion<span class="w"> </span>bash<span class="w"> </span>><span class="w"> </span>/etc/bash_completion.d/lxc<span class="w"> </span><span class="c1"># generating completions for bash as an example</span> .<span class="w"> </span>/etc/bash_completion.d/lxc </pre></div> </div> </section> </section> <section id="manage-access-to-lxd"> <span id="installing-manage-access"></span><h2>Manage access to LXD<a class="headerlink" href="#manage-access-to-lxd" title="Link to this heading">¶</a></h2> <p>Access control for LXD is based on group membership. The root user and all members of the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group can interact with the local daemon.</p> <p>On Ubuntu images, the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group already exists and the root user is automatically added to it. The group is also created during installation if you <a class="reference internal" href="#installing-snap-package"><span class="std std-ref">installed LXD from the snap</span></a>.</p> <p>To check if the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group exists, run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>getent<span class="w"> </span>group<span class="w"> </span>lxd </pre></div> </div> <p>If this command returns no result, the <code class="docutils literal notranslate"><span class="pre">lxd</span></code> group is missing from your system. This might be the case if you <a class="reference internal" href="#installing-from-source"><span class="std std-ref">installed LXD from source</span></a>. To create the group and restart the LXD daemon, run:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>getent<span class="w"> </span>group<span class="w"> </span>lxd<span class="w"> </span>>/dev/null<span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>groupadd<span class="w"> </span>--system<span class="w"> </span>lxd </pre></div> </div> <p>Afterward, add trusted users to the group so they can use LXD. The following command adds the current user:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>getent<span class="w"> </span>group<span class="w"> </span>lxd<span class="w"> </span><span class="p">|</span><span class="w"> </span>grep<span class="w"> </span>-qwF<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span><span class="w"> </span><span class="o">||</span><span class="w"> </span>sudo<span class="w"> </span>usermod<span class="w"> </span>-aG<span class="w"> </span>lxd<span class="w"> </span><span class="s2">"</span><span class="nv">$USER</span><span class="s2">"</span> </pre></div> </div> <p>Afterward, apply the change to your current shell session by running:</p> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>newgrp<span class="w"> </span>lxd </pre></div> </div> <div class="important admonition"> <p class="admonition-title">Important security notice</p> <p>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.</p> <p>Therefore, you should only give such access to users who you’d trust with root access to your system.</p> <p>For more information, see <a class="reference internal" href="../explanation/security/#security-daemon-access"><span class="std std-ref">Access to the LXD daemon</span></a>.</p> </div> </section> <section id="upgrade-lxd"> <span id="installing-upgrade"></span><h2>Upgrade LXD<a class="headerlink" href="#upgrade-lxd" title="Link to this heading">¶</a></h2> <p>After upgrading LXD to a newer version, LXD might need to update its database to a new schema. This update happens automatically when the daemon starts up after a LXD upgrade. A backup of the database before the update is stored in the same location as the active database (for example, at <code class="docutils literal notranslate"><span class="pre">/var/snap/lxd/common/lxd/database</span></code> for the snap installation).</p> <div class="admonition important"> <p class="admonition-title">Important</p> <p>After a schema update, older versions of LXD might regard the database as invalid. That means that downgrading LXD might render your LXD installation unusable.</p> <p>In that case, if you need to downgrade, restore the database backup before starting the downgrade.</p> </div> </section> </section> </article> </div> <footer> <div class="related-pages"> <a class="next-page" href="../howto/initialize/"> <div class="page-info"> <div class="context"> <span>Next</span> </div> <div class="title">How to initialize LXD</div> </div> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> </a> <a class="prev-page" href="../getting_started/"> <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> <div class="page-info"> <div class="context"> <span>Previous</span> </div> <div class="title">Getting started</div> </div> </a> </div> <div class="bottom-of-page"> <div class="left-details"> <div class="copyright"> Copyright © 2014-2025 LXD contributors </div> <div class="last-updated"> Last updated on Sep 08, 2025</div> <div class="show-source"> <a class="muted-link" href="../_sources/installing.md.txt" rel="nofollow">Show source</a> </div> </div> <div> <a class="display-contributors">Thanks to the 12 contributors!</a> <div id="overlay"></div> <ul class="all-contributors"> <li> <a href="https://github.com/canonical/lxd/commit/f044be9c10d2df8b9e8b70ed51a5aa30b9b7ddff" class="contributor">Alexander Mikhalitsyn</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/7290973108174e60a87ec03b309ad67dcab7034e" class="contributor">Hiroaki Nakamura</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/478ec83282e0a74a6ffb07fb0ee6eb795efa33a6" class="contributor">Kadin Sayani</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/c6450732dc1039552ed443d3de357301c70b7f89" class="contributor">Mark Laing</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/7d7f0e0b22d97b36006fcf524331ace39853edd0" class="contributor">Minae Lee</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/101ec620a7b1d442f39f5171d395f26a514e951b" class="contributor">Ruth Fuchss</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/3466d26e52cc2dfc79efbd616d97b1c461f9a3fd" class="contributor">Simon Deziel</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/9e2e2bef3b895b24cac85bec07eeffbfcd7189b1" class="contributor">Stéphane Graber</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/cc3022beadc866f6e8e0fa36dda5b00626644e58" class="contributor">Thomas Hipp</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/d61414d27e595a886df65da517996f2f381f6419" class="contributor">Thomas Parrott</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/057f84859336113119cdb91bbf58cb33800a94fc" class="contributor">Tom Parrott</a> </li> <li> <a href="https://github.com/canonical/lxd/commit/46f6af68b8ec4c75a58ece4149aadd5f4ce28814" class="contributor">hamistao</a> </li> </ul> </div> <div class="right-details"> <div class="ask-discourse"> <a class="muted-link" href="https://discourse.ubuntu.com/c/lxd/">Ask a question on Discourse</a> </div> <div class="ask-matrix"> <a class="muted-link" href="https://matrix.to/#/#documentation:ubuntu.com">Ask a question on Matrix</a> </div> <div class="issue-github"> <a class="muted-link" href="https://github.com/canonical/lxd/issues/new?title=doc%3A+ADD+A+TITLE&body=DESCRIBE+THE+ISSUE%0A%0A---%0ADocument: installing.md">Open a GitHub issue for this page</a> </div> <div class="edit-github"> <a class="muted-link" href="https://github.com/canonical/lxd/edit/main/doc/installing.md">Edit this page on GitHub</a> </div> </div> </div> </div> </footer> </div> <aside class="toc-drawer"> <div class="toc-sticky toc-scroll"> <div class="toc-title-container"> <span class="toc-title"> Contents </span> </div> <div class="toc-tree-container"> <div class="toc-tree"> <ul> <li><a class="reference internal" href="#">How to install LXD</a><ul> <li><a class="reference internal" href="#install-the-lxd-snap-package">Install the LXD snap package</a><ul> <li><a class="reference internal" href="#requirements">Requirements</a></li> <li><a class="reference internal" href="#install">Install</a><ul> <li><a class="reference internal" href="#optionally-specify-a-channel">Optionally specify a channel</a></li> </ul> </li> <li><a class="reference internal" href="#post-installation">Post-installation</a><ul> <li><a class="reference internal" href="#add-the-current-user">Add the current user</a></li> <li><a class="reference internal" href="#hold-or-schedule-updates">Hold or schedule updates</a></li> </ul> </li> </ul> </li> <li><a class="reference internal" href="#other-linux-installation-options">Other Linux installation options</a></li> <li><a class="reference internal" href="#other-operating-systems">Other operating systems</a></li> <li><a class="reference internal" href="#native-builds-of-the-client">Native builds of the client</a></li> <li><a class="reference internal" href="#install-lxd-from-source">Install LXD from source</a><ul> <li><a class="reference internal" href="#from-source-build-the-latest-version">From source: Build the latest version</a></li> <li><a class="reference internal" href="#from-source-build-a-release">From source: Build a release</a></li> <li><a class="reference internal" href="#start-the-build">Start the build</a></li> <li><a class="reference internal" href="#from-source-install">From source: Install</a></li> <li><a class="reference internal" href="#machine-setup">Machine setup</a></li> <li><a class="reference internal" href="#shell-completions">Shell completions</a></li> </ul> </li> <li><a class="reference internal" href="#manage-access-to-lxd">Manage access to LXD</a></li> <li><a class="reference internal" href="#upgrade-lxd">Upgrade LXD</a></li> </ul> </li> </ul> </div> </div> <div class="relatedlinks-title-container"> <span class="relatedlinks-title"> Related links </span> </div> <div class="relatedlinks-container"> <div class="relatedlinks"> <ul><li><a href="https://discourse.ubuntu.com/t/37327" target="_blank">Discourse: Building custom LXD binaries for side loading into an existing snap installation</a></li></ul> </div> </div> </div> </aside> </div> </div><script src="../_static/jquery.js?v=5d32c60e"></script> <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> <script src="../_static/documentation_options.js?v=187304be"></script> <script src="../_static/doctools.js?v=9bcbadda"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <script src="../_static/scripts/furo.js?v=46bd48cc"></script> <script src="../_static/clipboard.min.js?v=a7894cd8"></script> <script src="../_static/copybutton.js?v=f281be69"></script> <script src="../_static/config-options.js"></script> <script src="../_static/design-tabs.js?v=f930bc37"></script> <script src="../_static/tabs.js?v=3030b3cb"></script> <script src="../_static/header-nav.js?v=e117ad08"></script> <script src="../_static/footer.js?v=5acea47a"></script> <script src="../_static/github_issue_links.js?v=32bb732f"></script> <script src="../_static/js/bundle.js?v=a4d88309"></script> <script> const github_url = "https://github.com/canonical/lxd"; </script> </body> </html>
Copyright ©2k19 -
Hexid
|
Tex7ure