Can't Install a LibreNMS on Ubuntu Ubuntu 24.04.3 LTS (NGINX)

Hello all,

First of all, thank you very much for releasing LibreNMS as FLOSS (and using the GPL3).

  • Steps to reproduce an issue.

I setup LibreNMS from this Site (Doc LibreNMS Site)

If i came up to the point: “Webinstaller” (http://librenms.example.com/install) i get the “502“ Error by NGINX. Long time i read here in the community about this (30 results for502 error nginx)

Now that I’ve tried “all” the options, I’m turning to you (somewhat desperately). :wink:

I followed the (many) tips, for example:

i do: sudo /usr/sbin/php-fpm8.3 --nodaemonize --fpm-config /etc/php/8.3/fpm/php-fpm.conf

i have “checkout” a earlyer version & have done the ./daily.sh

i have test it with 2 options in /etc/php/8.3/fpm/pool.d/librenms.conf

# listen = /run/php-fpm-libremns.sock

;listen = 127.0.0.1:9000

I have “kick off“ => sudo aa-teardown

nothing helped :frowning:

php -v
PHP 8.3.6 (cli) (built: Jul 14 2025 18:30:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies

  • The output of ./validate.php

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 25.9.0-dev.42+acf742d05 (2025-09-10T14:48:39+00:00)
DB Schema No Schema (0)
PHP 8.3.6
Python 3.12.3
Database MariaDB 10.11.13-MariaDB-0ubuntu0.24.04.1
RRDTool 1.7.2
SNMP 5.9.4.pre2
===========================================

[OK] Composer Version: 2.8.11
[OK] Dependencies up-to-date.
Exception: Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist (Connection: mysql, SQL: select exists(select * from devices) as exists) @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:824
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(778): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(397): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3561): Illuminate\Database\Connection->select()
#3 /opt/librenms/LibreNMS/Validations/Configuration.php(53): Illuminate\Database\Query\Builder->exists()
#4 /opt/librenms/LibreNMS/Validator.php(90): LibreNMS\Validations\Configuration->validate()
#5 /opt/librenms/validate.php(147): LibreNMS\Validator->validate()
#6 {main}

In Connection.php line 824:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist (Connection: mysql, SQL: select exists(select * from devices) as
exists)

In Connection.php line 406:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist

nginx error.log tells:

2025/09/12 11:19:43 [crit] 1622215#1622215: *1 connect() to unix:/run/php-fpm-librenms.sock failed (2: No such file or directory) while connecting to upstream, client: $CLIENT_IP, server: $LIBRENMS_SVR_NAME, request: “GET /install HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm-librenms.sock:”, host: “$LIBRESERVER_IP”
2025/09/12 11:19:58 [crit] 1622218#1622218: *5 connect() to unix:/run/php-fpm-librenms.sock failed (2: No such file or directory) while connecting to upstream, client: $CLIENT_IP, server: $LIBRESERVER_NAME, request: “GET /install HTTP/1.1”, upstream: “fastcgi://unix:/run/php-fpm-librenms.sock:”, host: “$HOSTNAME_LIBRENMS”

What else can I do?
Thanks in advance.

Mike

This is your clue. It says you didn’t start php-fpm. (or maybe configure it)

Make sure you follow the install directions carefully.

Hello murrant

Thanks for your Help. I checked the setup several times and also looked around here in the forum before I wrote here. :wink:

my “librenms.conf”

; pool name (‘www’ here)
[librenms]

and…

; Default Values: The user is set to master process running user by default.
; If the group is not set, the user’s group is used.
user = librenms
group = librenms

so on…

; ‘/path/to/unix/socket’ - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php-fpm-libremns.sock
;listen = 127.0.0.1:9000

i have test both - the line with “localhost”, i found this here in the forum.

and if i do “librenms@librenms_server:~$ ./validate.php“

===========================================

Component Version
LibreNMS 25.9.0-dev.45+ffbb4aa39 (2025-09-12T17:27:38+00:00)
DB Schema No Schema (0)
PHP 8.3.6
Python 3.12.3
Database MariaDB 10.11.13-MariaDB-0ubuntu0.24.04.1
RRDTool 1.7.2
SNMP 5.9.4.pre2
===========================================

[OK] Composer Version: 2.8.11
[OK] Dependencies up-to-date.
Exception: Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist (Connection: mysql, SQL: select exists(select * from devices) as exists) @ /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php:824
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(778): Illuminate\Database\Connection->runQueryCallback()
#1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Connection.php(397): Illuminate\Database\Connection->run()
#2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3561): Illuminate\Database\Connection->select()
#3 /opt/librenms/LibreNMS/Validations/Configuration.php(53): Illuminate\Database\Query\Builder->exists()
#4 /opt/librenms/LibreNMS/Validator.php(90): LibreNMS\Validations\Configuration->validate()
#5 /opt/librenms/validate.php(147): LibreNMS\Validator->validate()
#6 {main}

In Connection.php line 824:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist (Connection: mysql, SQL: select exists(select * from devices) as
exists)

In Connection.php line 406:

SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist

Hint:

-rw-r–r-- 1 root root 22128 Sep 12 10:21 librenms.conf

The 502 error you’re encountering is because NGINX cannot connect to the PHP-FPM socket file, as indicated by the error message “connect() to unix:/run/php-fpm-librenms.sock failed (2: No such file or directory)” . This typically means the socket file doesn’t exist or NGINX is configured to look for it in the wrong location .

fix this:

  1. Check if PHP-FPM is Running:
    Ensure the PHP-FPM service for your LibreNMS pool is actually running. The command you used (sudo /usr/sbin/php-fpm8.3 --nodaemonize --fpm-config /etc/php/8.3/fpm/php-fpm.conf) runs it in the foreground. You should start it as a service:

    sudo systemctl start php8.3-fpm
    sudo systemctl enable php8.3-fpm # To start on boot
    sudo systemctl status php8.3-fpm # Check its status
    

    Make sure the service is active and running without errors.

  2. Verify the Socket File Location and Existence:
    The error suggests NGINX is looking for /run/php-fpm-librenms.sock. Check if this file actually exists:

    ls -l /run/php-fpm-librenms.sock
    

    If it doesn’t exist, PHP-FPM likely isn’t running or is configured to use a different socket or TCP port.

  3. Check Your PHP-FPM Pool Configuration:
    You mentioned trying both listen = /run/php-fpm-libremns.sock and listen = 127.0.0.1:9000 in /etc/php/8.3/fpm/pool.d/librenms.conf.

    • Typo: Note the typo in your first option: libremns.sock should be librenms.sock.
    • Consistency: Whichever listen directive you choose (socket or TCP), you must ensure your NGINX configuration (/etc/nginx/sites-enabled/librenms.conf or similar) uses the exact same value in its fastcgi_pass directive.
    • Restart PHP-FPM: After making any changes to the pool config, restart the PHP-FPM service: sudo systemctl restart php8.3-fpm.
  4. Check Your NGINX Configuration:
    Open your LibreNMS NGINX site configuration file (e.g., /etc/nginx/sites-enabled/librenms.conf). Find the location ~ \.php$ block and check the fastcgi_pass line.

    • If your PHP-FPM pool uses listen = /run/php-fpm-librenms.sock, then NGINX should have fastcgi_pass unix:/run/php-fpm-librenms.sock;.
    • If your PHP-FPM pool uses listen = 127.0.0.1:9000, then NGINX should have fastcgi_pass 127.0.0.1:9000;.
    • Ensure the path in the fastcgi_pass directive matches exactly what is defined in the listen directive of your PHP-FPM pool config.
  5. Check Socket Permissions (if using socket):
    If you are using a Unix socket, ensure the NGINX worker process (usually running as user www-data or nginx) has permission to read and write to the socket file . The socket’s user/group and permissions are usually set within the PHP-FPM pool configuration (listen.owner, listen.group, listen.mode).

  6. Reload NGINX:
    After making any changes to the NGINX configuration, reload it:

    sudo nginx -t # Test the configuration first
    sudo systemctl reload nginx
    

The database errors from validate.php are expected at this stage because you haven’t completed the web installer yet, which creates the database schema. Focus on fixing the 502 error first; once the web installer loads, it should guide you through the database setup. The core issue is getting NGINX to successfully communicate with PHP-FPM .

Big Thanks @lagister

i follow exactly yours point to point manual…

  1. => sudo systemctl status php8.3-fpm.service
    ● php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager
    Loaded: loaded (/usr/lib/systemd/system/php8.3-fpm.service; enabled; preset: enabled)
    Active: active (running) since Tue 2025-09-16 13:38:29 UTC; 8min ago
    Docs: man:php-fpm8.3(8)
    Process: 1035 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.3/fpm/pool.d/www.conf 83 (code=exited, status=0/SUCCES>
    Main PID: 801 (php-fpm8.3)
    Status: “Processes active: 0, idle: 4, Requests: 0, slow: 0, Traffic: 0req/sec”
    Tasks: 5 (limit: 38423)
    Memory: 33.4M (peak: 34.1M)
    CPU: 384ms
    CGroup: /system.slice/php8.3-fpm.service
    ├─ 801 “php-fpm: master process (/etc/php/8.3/fpm/php-fpm.conf)”
    ├─1029 “php-fpm: pool librenms”
    ├─1030 “php-fpm: pool librenms”
    ├─1031 “php-fpm: pool www”
    └─1032 “php-fpm: pool www”

    Sep 16 13:38:27 myhost systemd[1]: Starting php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager…
    Sep 16 13:38:29 myhost systemd[1]: Started php8.3-fpm.service - The PHP 8.3 FastCGI Process Manager.

  2. service is up & running

  3. =>

drwxr-xr-x 2 www-data www-data 100 Sep 16 13:38 php
srwxrwxr-x 1 www-data www-data 0 Sep 16 13:38 php-fpm-libremns.sock

looks fine

typo - ok, is out…

7 & 8

sudo cat /etc/nginx/sites-enabled/librenms.conf
server {
listen 80;
server_name myhost.domain.foo;
root /opt/librenms/html;
index index.php;

charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/].php(/|$) {
fastcgi_pass unix:/run/php-fpm-librenms.sock;

9 pls, look at point 3 for socket permisssions… ok?

10: 2025/09/16 14:15:17 [warn] 13605#13605: conflicting server name “myhost.domain.foo” on 0.0.0.0:80, ignored
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

hostname is “myhost”

i have a A record for myhost.domain.foo in my DNS

the error message SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘librenms.devices’ doesn’t exist is a clear indicator that the LibreNMS database schema has not been correctly initialized.

Try to run the database migration command. As the LibreNMS user, navigate to your LibreNMS installation directory and execute the following:

cd /opt/librenms
./lnms migrate

after this, navigate to your server’s IP address in a web browser to access the web installer.

After running the migration and completing the web installation, you should run the validation script again to ensure all issues are resolved:

./validate.php

PS: Nginx and PHP-FPM setup appears to be mostly correct. (ensure there are no duplicates in config files. same server name ? )

Good Morning @lagister (and the hole community)

Thanks for your Help. but now: “i am back to “root”(s)

i have a fresh install of Debian 12 …

Im back to the LibreNMS install docu, on the way to…

./scripts/composer_wrapper.php install --no-dev (As User: “librenms”)

After runnig the composer → i get the Msg:

scripts/dynamic_check_requirements.py || pip3 install --user -r requirements.txt || :
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

“apt tells me”: python3 ist schon die neueste Version (3.11.2-1+b1). i have also python3-full and the pipx pre installed

Please excuse me for not doing a better job with Ubuntu. I thought it would be “easier” to get LibreNMS up and running under Debian.

Here is the hole Output from the composer:

I’m really not sure what you are trying to do here? Do you have all the python dependencies installed as per the install docs?

If so, you shouldn’t get this error. The error is probably because LibreNMS tries to install a missing package via PIP, but that is blocked by python/debian because they doesn’t like that.