
MeshCentral installs in a way that surprises many people who are used to traditional server software: there is no large installer to click through and no complicated stack of web server, application server and database to assemble. The whole platform is a Node.js package, so a working server can be running within minutes. Turning that first working server into something reliable enough to manage real computers, however, takes a little more thought. This article walks through a complete Linux installation, explains the decisions that matter along the way and shows how to avoid the mistakes that cause most early problems.
The focus here is on Ubuntu and Debian, because they are the distributions most often used for self-hosted MeshCentral servers and because their package tools are well documented. The same principles apply to other distributions, with only the package commands changing.
Planning the Server Before You Install
A few minutes of planning save hours of rework later. Before typing a single command, it is worth answering four questions.
Where will the server live?
A server on your local network is ideal for learning and for managing machines in a single building. A virtual private server with a public address is the usual choice when devices are spread across homes, branch offices or customer sites. Either works, but the choice affects certificates, firewall rules and how agents will reach the server.
What name will people use?
Agents and browsers connect to the server by name. If you intend to use the server over the internet, register a domain or subdomain such as a dedicated management hostname, point its DNS record at the server and use that name consistently from the start. Changing the name later is possible, but agents already installed are tied to the server's identity and may need to be reinstalled.
Which database will you use?
For small deployments, the built-in local database needs no extra software at all. Larger fleets, or anyone planning several servers working together, should consider MongoDB, PostgreSQL or MariaDB/MySQL from the outset. Migrating later is supported, but starting with the right database is simpler.
Who will maintain it?
A remote management server deserves the same care as any other critical system. Decide who applies updates, who checks backups and who is notified when something goes wrong.
Preparing the Operating System
Start with a fully updated system and a non-root user with sudo rights.
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl ca-certificates
It is good practice to run MeshCentral under its own dedicated account rather than as root or as your personal login. That keeps the server's files separate and limits the damage if anything is ever compromised.
sudo useradd -r -m -d /opt/meshcentral -s /bin/bash meshcentral
Installing a Suitable Node.js Version
MeshCentral is written in JavaScript and runs on Node.js, so the runtime version matters. Recent MeshCentral releases require Node.js 20 or later, and the release notes state when that requirement changes. The Node.js packages shipped by some distributions lag well behind, so most administrators install a current long-term support release from the NodeSource repository or with a version manager.
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node --version
npm --version
If the version printed is older than the requirement of the release you plan to run, stop and fix that first. An unsupported runtime is one of the most common reasons a server refuses to start after an upgrade.
Installing the MeshCentral Package
Switch to the dedicated account, move into its home folder and install the package with npm. The official guidance is clear on one point that catches many people out: do not put sudo in front of the npm command. Running npm as root creates files the service account cannot later modify, which breaks updates and automatic module installation.
sudo su - meshcentral
cd /opt/meshcentral
npm install meshcentral
npm creates a node_modules folder containing the server code. Nothing has started yet.
Running the Server for the First Time
The first run creates the folders that hold everything important and generates the certificates the server needs. Start it in the foreground so you can watch the output.
node node_modules/meshcentral --cert mesh.yourdomain.example
The --cert option tells MeshCentral which name or IP address to put in its self-signed certificate. On startup you will see the server report the ports it is listening on and the folders it has created:
meshcentral-dataholds the configuration file, certificates and, with the built-in database, the database files themselves.meshcentral-filesstores files uploaded to the server, such as items users keep in their personal storage.meshcentral-backupsis where automatic backups are written by default.
Of these, the data folder is the one you must never lose. It contains the private keys that agents use to recognise the server. If those keys disappear, every agent will refuse to trust a rebuilt server and will have to be reinstalled.
Back up the meshcentral-data folder as soon as the first run completes, and keep a copy somewhere other than the server itself.
Press Ctrl+C to stop the server once you have confirmed that it starts cleanly.
Dealing with Privileged Ports
On Linux, programs running as an ordinary user cannot bind to ports below 1024, which includes the standard HTTPS port 443 and HTTP port 80. If MeshCentral cannot use them, it falls back to alternative ports and says so in its output. There are three common ways to solve this.
- Grant the Node.js binary the capability to bind low ports with
setcap. This is quick, but the capability is lost when a package upgrade replaces the Node.js binary, so it must be reapplied after every Node.js update. - Let the systemd service grant the capability through its unit file, which survives Node.js upgrades.
- Place a reverse proxy such as NGINX or HAProxy in front of MeshCentral, letting the proxy own ports 80 and 443 while MeshCentral listens on a higher port.
For most single-server installations, the systemd approach is the tidiest.
Configuring config.json
Inside meshcentral-data you will find a config.json file. It controls almost everything about the server. A minimal, sensible configuration for a server with its own domain looks like this:
{
"settings": {
"cert": "mesh.yourdomain.example",
"port": 443,
"redirPort": 80,
"WANonly": true
},
"domains": {
"": {
"title": "Company Device Management",
"newAccounts": false
}
}
}
A few points are worth highlighting. Keys beginning with an underscore are ignored, which is a convenient way to keep an option in the file while switching it off. The newAccounts setting stops strangers from registering once your own administrator account exists. The WANonly option disables local network discovery features that are unnecessary on an internet-facing server. JSON is unforgiving about commas and quotation marks, so validate the file after every edit.
Running MeshCentral as a Service
A server that only runs while your terminal is open is not much use. MeshCentral can register itself as a background service, and on modern Linux systems that means a systemd unit. You can let MeshCentral create it with its --install option, or write one yourself for full control:
[Unit]
Description=MeshCentral Server
After=network.target
[Service]
Type=simple
User=meshcentral
WorkingDirectory=/opt/meshcentral
ExecStart=/usr/bin/node /opt/meshcentral/node_modules/meshcentral
Restart=always
RestartSec=10
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
Save it as a service file, then reload systemd, enable the service and start it.
sudo systemctl daemon-reload
sudo systemctl enable --now meshcentral
sudo systemctl status meshcentral
The Restart=always line means the server comes back automatically after a crash, and AmbientCapabilities lets it bind to ports 80 and 443 without running as root.
Opening the Firewall
If the server uses a host firewall, allow the ports it needs. With UFW on Ubuntu, that is typically:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
Port 80 is used to redirect browsers to HTTPS and, if you use Let's Encrypt, to prove control of the domain. If you manage Intel AMT devices using client-initiated remote access, port 4433 must also be reachable. Do not open anything you do not need.
Creating the Administrator Account
Browse to the server's name. With the default self-signed certificate, your browser will display a warning; that is expected until you install a trusted certificate. The first account created on a fresh server automatically becomes the site administrator, so create it immediately, before anyone else can reach the page. Choose a long, unique password and enable two-factor authentication straight away from the account settings.
Once your account exists, confirm that newAccounts is set to false so that the registration link disappears from the login page.
Adding the First Devices
From the dashboard, create a device group. The most common type manages computers using a software agent. Open the group and choose the option to add an agent. MeshCentral offers installers for each supported operating system, along with a one-line installation script for Linux and macOS. Each installer is linked to that specific group and carries the information the agent needs to find and trust your server.
Install the agent on a test computer you own. Within a few seconds it should appear in the group with a status showing that the agent is connected. From there, the Desktop, Terminal and Files tabs become available, subject to the permissions on your account.
Updating an npm Installation
Updating follows the same pattern as installing. Stop the service, back up the data folder, install the newer package in the same folder and start the service again.
sudo systemctl stop meshcentral
sudo -u meshcentral bash -c "cd /opt/meshcentral && npm install meshcentral"
sudo systemctl start meshcentral
Always read the release notes first. Some releases fix security issues and should be applied quickly; others change runtime requirements and need a Node.js upgrade beforehand.
Common Installation Mistakes
- Running npm with sudo, leaving files owned by root that the service account cannot change.
- Installing with an outdated Node.js release from the distribution's default repositories.
- Forgetting to back up
meshcentral-databefore experimenting with certificates. - Leaving open registration enabled on an internet-facing server.
- Using an IP address for the certificate and later switching to a domain name, which forces agents to be reinstalled.
- Editing
config.jsonwithout checking that the JSON is still valid.
Frequently Asked Questions
Yes. As long as a supported Node.js version is available for the board's architecture, the npm installation works in the same way. A Raspberry Pi is comfortable for a home lab or a modest number of devices.
No. The built-in local database works without any additional software. A dedicated database such as MongoDB or PostgreSQL becomes worthwhile for larger fleets or multi-server setups.
On Linux, non-root programs cannot bind to ports below 1024. Grant the capability through systemd, use setcap or place a reverse proxy in front of the server.
It is config.json inside the meshcentral-data folder, which is created the first time the server runs.
Yes, provided you copy the meshcentral-data folder, including its certificates and keys, and keep the same hostname. Agents will then recognise the new server as the old one.
It is the method the project itself documents. Combined with a dedicated service account, a systemd unit, a trusted certificate and regular backups, it is a sound production setup.
Conclusion
Installing MeshCentral on Linux is straightforward once the essentials are in place: a supported Node.js version, a dedicated service account, a carefully edited config.json and a systemd service that keeps the server running. The most important habit to build from the very first day is protecting the meshcentral-data folder, because it carries the identity that every agent relies on. With registration closed, two-factor authentication enabled and backups scheduled, the server is ready to take on real work.