Set up a self-hosted Landscape Server
on UbuntuMinimum requirements for landscape server
- Ubuntu 22.04 LTS (Jammy Jellyfish) or Ubuntu 24.04 LTS (Noble Numbat)
- For hardware: a dual core 2 Ghz processor, 4 GB of RAM, and 20 GB of disk space
- For networking: an IP address and FQDN, with TCP communication allowed for SSH (typically port 22), HTTP (port 80), HTTPS (port 443), and gRPC (6554)
- DNS administration access for the domain you will use to access Landscape is necessary, if you wish to use LetsEncrypt to obtain an SSL certificate.
2 ways to install landscape server
Install Landscape Server to manage machines and containers
Attach Pro Token
-
Get token from ubuntu.com/pro/dashboard
sudo pro attach
Install
-
Install prerequisites
sudo apt update && sudo apt install -y ca-certificates software-properties-common
-
Set your hostname using variables
Set landscape.example.com with the FQDN pointing to your server.
sudo hostnamectl set-hostname "$FQDN"
-
Add the Landscape PPA
sudo add-apt-repository -y ppa:landscape/self-hosted-24.04
-
Install Landscape
sudo apt update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y landscape-server-quickstart
Configure SSL
If you have the fullchain.pem and privkey.pem files for your SSL certificate, skip these steps and configure Apache manually.
-
Install certbot
sudo snap install certbot --classic
-
Set your email address in a variable
EMAIL="[email protected]"
-
Get and install your certificate
sudo certbot --apache --non-interactive --no-redirect --agree-tos --email $EMAIL --domains $(hostname --long)
Configure postfix for email
Detailed information is available for Postfix in the Ubuntu Server documentation.
-
Set SMTP information in variables
The value of SMTP_PASSWORD should be the SendGrid API Key
SMTP_HOST='smtp.sendgrid.net' SMTP_PORT='587' SMTP_USERNAME='apikey' SMTP_PASSWORD='YOUR_API_KEY_GOES_HERE'
-
Install postfix
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y postfix
-
Configure postfix
sudo postconf -e myhostname="$(hostname --long)" sudo postconf -e mydomain="$(hostname --domain)" sudo postconf -e myorigin="$(hostname --domain)" sudo postconf -e masquerade_domains="$(hostname --domain)" sudo postconf -e mydestination=localhost sudo postconf -e default_transport=smtp sudo postconf -e relay_transport=smtp sudo postconf -e relayhost="[${SMTP_HOST}]:${SMTP_PORT}" sudo postconf -e smtp_tls_security_level=encrypt sudo postconf -e smtp_sasl_auth_enable=yes sudo postconf -e smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd sudo postconf -e header_size_limit=4096000 sudo postconf -e smtp_sasl_security_options=noanonymous sudo postconf -e smtp_use_tls=yes sudo postconf -e smtp_tls_security_level=encrypt sudo postconf -e smtp_sasl_tls_security_options=noanonymous
-
Write sasl_passwd
sudo sh -c "echo \"[$SMTP_HOST]:$SMTP_PORT $SMTP_USERNAME:$SMTP_PASSWORD\" > /etc/postfix/sasl_passwd"
-
Generate sasl_passwd.db
sudo postmap /etc/postfix/sasl_passwd
-
Secure sasl_passwd.db
sudo chmod 600 /etc/postfix/sasl_passwd.db
-
Remove sasl_passwd
sudo rm /etc/postfix/sasl_passwd
-
Restart postfix
sudo /etc/init.d/postfix restart
Set aside some time
Read the Manual Installation documentation
Install Landscape
Follow the Manual Installation documentation
4 ways to install landscape client
Install Landscape Client
to manage machines and containersLandscape Client can be installed from Ubuntu's main repository. The latest version can be obtained from the Landscape Beta PPA.
Install
-
Install the package
sudo apt update && sudo apt install -y landscape-client
Configure
-
Define parameters in variables
Self-hosted Landscape users should set LANDSCAPE_ACCOUNT_NAME as
standalone
, Landscape SaaS customers should specify their account name and set LANDSCAPE_FQDN aslandscape.canonical.com
.LANDSCAPE_ACCOUNT_NAME='standalone' LANDSCAPE_FQDN='landscape.example.com' LANDSCAPE_COMPUTER_TITLE='My Computer'
-
Configure
sudo landscape-config --silent --account-name="${LANDSCAPE_ACCOUNT_NAME}" --computer-title="${LANDSCAPE_COMPUTER_TITLE}" --tags="" --script-users='nobody,landscape,root' --url "https://${LANDSCAPE_FQDN}/message-system" --ping-url "http://${LANDSCAPE_FQDN}/ping"
Install
-
Install prerequisites
sudo apt update && sudo apt install -y software-properties-common
-
Add the PPA
sudo add-apt-repository -y ppa:landscape/self-hosted-beta
-
Install
sudo apt update && sudo apt install -y landscape-client
Configure
-
Define parameters in variables
Self-hosted Landscape users should set LANDSCAPE_ACCOUNT_NAME as
standalone
, Landscape SaaS customers should specify their account name and set LANDSCAPE_FQDN aslandscape.canonical.com
.LANDSCAPE_ACCOUNT_NAME='standalone' LANDSCAPE_FQDN='landscape.example.com' LANDSCAPE_COMPUTER_TITLE='My Computer'
-
Configure
sudo landscape-config --silent --account-name="${LANDSCAPE_ACCOUNT_NAME}" --computer-title="${LANDSCAPE_COMPUTER_TITLE}" --tags='' --script-users='nobody,landscape,root' --ping-url="http://${LANDSCAPE_FQDN}/ping" --url="https://${LANDSCAPE_FQDN}/message-system"
Install
-
Define parameters in variables
Self-hosted Landscape users should set LANDSCAPE_ACCOUNT_NAME as
standalone
, Landscape SaaS customers should specify their account name and set LANDSCAPE_FQDN aslandscape.canonical.com
.LANDSCAPE_ACCOUNT_NAME='standalone' LANDSCAPE_FQDN='landscape.example.com'
-
Deploy the charm
juju deploy landscape-client --config account-name='standalone' --config tags='' --config script-users='nobody,landscape,root' --config ping-url="http://${LANDSCAPE_FQDN}/ping" --config url="https://${LANDSCAPE_FQDN}/message-system"
Configure
-
Relate the charm
juju relate landscape-client <charm-name>
To install landscape-client from a PPA
apt:
sources:
trunk-testing-ppa:
source: ppa:landscape/self-hosted-24.04
Configure landscape-client
To discover additional supported client keys visit the cloud-init Landscape module documentation.
Self-hosted Landscape users should set account_name as `standalone` and define the url and ping_url keys. Landscape SaaS customers should specify their account name, and the url and ping_url keys can be omitted.
landscape:
client:
account_name: standalone
computer_title: "My Computer"
url: "https://landscape.example.com/message-system"
ping_url: "http://landscape.example.com/ping"