This tutorial walks you through installing the Mako Server as a systemd
service using Ansible. Once installed, the server will automatically start at boot and can be managed using systemctl
.
This tutorial assumes the Mako binary is already installed at /usr/local/bin/mako
. If not, download it from makoserver.net/download and place it there before proceeding or use the Ansible Mako Server Compilation Script with the -e install=true
option.
The Ansible Mako Server Compilation Script includes additional Ansible information you may find helpful.
You can install the Mako Server as a service on either a local machine or a remote machine.
Run the following command to install and configure the Mako Server service on your local machine:
ansible-playbook -i localhost, -c local install.yaml -e username=mako-username -e password=mako-password
Replace mako-username
and mako-password
with suitable Mako Server/Xedge IDE login credentials.
- Creates a system user (
mako
) - Clones the example resources into
/opt/mako
- Runs the Xedge IDE build script to prepare
Xedge.zip
- Sets up the
mako.conf
configuration file to load Xedge.zip - Installs and enables a systemd service for Mako
To install the Mako Server service on a remote server, run:
ansible-playbook -i hostname, -u ubuntu install.yaml -e username=mako-username -e password=mako-password
Replace hostname
with the hostname or IP of your remote system and ubuntu
with the remote user's login. Make sure:
- SSH access is enabled to the remote host
- The user (
ubuntu
) has passwordless sudo privileges or add the ansible option --ask-become-pass
The remote install follows the same steps as the local one and will configure Mako as a persistent service that starts at boot.
After installation, verify the Mako Server is running:
systemctl status mako
journalctl -t mako
If everything is set up correctly, you should see the service active and running. You can now access the server using your browser.
You can manually control the service using:
sudo systemctl stop mako
sudo systemctl start mako
It is sometimes helpful to run the Mako Server as a foreground process:
sudo systemctl stop mako
cd /opt/mako
sudo mako -u mako
Using the Xedge IDE
Navigate to http://hostname, click the IDE link, and log in with the username/password combo you set when running the Ansible playbook - i.e. -e username=mako-username -e password=mako-password
All LSP Examples should be available. Start by testing the Light Dashboard using Xedge.
In the Xedge IDE:
- Expand
Home
in the left pane tree menu - Expand
LSP-examples
- Expand
Light-Dasboard
- Right click
htmx
- Select
New App
; in the application dialog:- Click
LSP App
- Remove directory name (leave blank)
- Click
Auto Start
- Click
Running
and theSave
button
- Click
- Navigate to hostname/ (the root) and check out the Dasboard
- You can add/remove pages by editing
htmx -> .lua -> menu.json
using the Xedge IDE
The mako.conf
file contains several important sections, including options for automatic certificate installation and email logging - both of which we recommend enabling. You can edit this file directly from the Xedge IDE. To do so, expand the home directory in the left-hand panel and open xedge.conf.
Add your configuration options, save the file, and restart the server. When testing changes to mako.conf
, it's recommended to run the Mako Server in the foreground (as explained earlier) so you can monitor outputs and catch any issues immediately.
To completely remove the service and all files, follow these steps:
sudo systemctl stop mako
sudo systemctl disable mako
sudo rm /etc/systemd/system/mako.service
sudo rm -rf /opt/mako
sudo userdel mako
sudo systemctl daemon-reload
sudo rm /usr/local/bin/mako*