-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv-example
More file actions
219 lines (183 loc) · 8.79 KB
/
Copy pathenv-example
File metadata and controls
219 lines (183 loc) · 8.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# LibreNMS Environment Configuration
# Copy this file to .env and customize the values
# Command: cp env-example .env && vi .env
# WARNING: Never commit the .env file to git - it contains secrets!
# ============================================================================
# QUICK START - CREDENTIALS SUMMARY
# ============================================================================
#
# ⚠️ WEB UI LOGIN (MUST BE CREATED ON FIRST ACCESS - NOT AUTO-CONFIGURED!):
# LibreNMS does NOT create admin accounts from environment variables.
# On first visit, the web UI will PROMPT you to create an admin account.
# The LIBRENMS_ADMIN_* variables below are REFERENCE ONLY for this purpose.
#
# When prompted by the web UI setup wizard, use these suggested values:
# Username: admin (or customize)
# Password: (choose a secure password - see LIBRENMS_ADMIN_PASSWORD below)
# Email: (see LIBRENMS_ADMIN_EMAIL below)
#
# DATABASE CREDENTIALS (used internally by containers - NOT for web login):
# Database Password: LIBRENMS_DB_PASSWORD (auto-generated complex password below)
# MySQL Root Password: MYSQL_ROOT_PASSWORD (auto-generated complex password below)
# Note: You never need to remember these - they're only used internally!
#
# REQUIRED TO CONFIGURE:
# - Choose a secure password for LIBRENMS_ADMIN_PASSWORD (you'll enter this in the web UI)
# - LIBRENMS_BASE_URL (your server's IP or hostname)
#
# ALREADY CONFIGURED (internal passwords - you don't need to change these):
# - LIBRENMS_DB_PASSWORD (auto-generated complex password below)
# - MYSQL_ROOT_PASSWORD (auto-generated complex password below)
# - LIBRENMS_BASE_URL (your server's IP or hostname)
#
# ============================================================================
# ============================================================================
# Database Configuration (Internal - NOT for Web UI login)
# ============================================================================
# These are database credentials used internally by LibreNMS containers
# You do NOT use these to log into the web interface
# Database connection details (hostname, port, database name, username)
LIBRENMS_DB_HOST=librenms-db
LIBRENMS_DB_PORT=3306
LIBRENMS_DB_NAME=librenms
LIBRENMS_DB_USER=librenms
# Database password (Internal only - you never need to use this password directly)
# Set to any complex random string - this is only used between containers
# Example: Use output from: openssl rand -base64 32
LIBRENMS_DB_PASSWORD=GENERATE_RANDOM_PASSWORD_HERE
# MySQL Root Password (Internal only - you never need to use this password directly)
# Set to any complex random string - this is only used for initial database setup
# Example: Use output from: openssl rand -base64 32
MYSQL_ROOT_PASSWORD=GENERATE_RANDOM_PASSWORD_HERE
# ============================================================================
# LibreNMS Web UI Admin Account (Auto-Created on First Deploy)
# ============================================================================
# These credentials are used to automatically create the admin user during
# deployment. The admin user is created using the LibreNMS CLI tool after
# the containers are started.
#
# ⚠️ IMPORTANT: These credentials are REQUIRED and will be used to log into
# the LibreNMS web interface. Keep them secure!
#
# Admin username for web UI login:
LIBRENMS_ADMIN_USER=admin
# Admin password for web UI login (CHANGE THIS to a strong password!):
LIBRENMS_ADMIN_PASSWORD=YOUR_SECURE_ADMIN_PASSWORD_HERE
# Admin email address:
LIBRENMS_ADMIN_EMAIL=admin@example.com
# ============================================================================
# Network Configuration
# ============================================================================
# IP address to bind services (use 0.0.0.0 for all interfaces or specific IP)
LIBRENMS_BIND_IP=0.0.0.0
# Base URL for LibreNMS (include protocol and port if not 80/443)
LIBRENMS_BASE_URL=http://YOUR_SERVER_IP_HERE
# HTTP/HTTPS Port Configuration
# Note: SNMP ports (161/UDP, 162/UDP) are configured automatically by the deployment script
# Uncomment to change from defaults:
#LIBRENMS_HTTP_PORT=80
#LIBRENMS_HTTPS_PORT=443
# HTTPS/SSL Configuration
# Set to "true" to enable HTTPS
# The deployment script will automatically generate self-signed certificates if they don't exist
# Or you can generate them manually with: ./scripts/installer-scripts-additional/generate-ssl-cert.sh
LIBRENMS_ENABLE_HTTPS=false
# SSL Certificate paths (optional - defaults shown below)
# Certificates are stored in the persistent data directory: /opt/librenms/certs/
# This keeps all persistent data (including certs) in one location
# If certificates already exist, deployment will ask if you want to keep them
# Leave these commented to use defaults:
#LIBRENMS_CERT_PATH=/opt/librenms/certs/librenms.crt
#LIBRENMS_KEY_PATH=/opt/librenms/certs/librenms.key
# ============================================================================
# Container Configuration
# ============================================================================
# Container image versions (using CentOS-based images, not Alpine)
LIBRENMS_IMAGE=docker.io/librenms/librenms:latest
MARIADB_IMAGE=docker.io/library/mariadb:10.11
REDIS_IMAGE=docker.io/library/redis:7
SNMPTRAPD_IMAGE=docker.io/librenms/librenms:latest
# Timezone - Examples for US timezones:
# America/New_York (Eastern)
# America/Chicago (Central)
# America/Denver (Mountain)
# America/Phoenix (Arizona - no DST)
# America/Los_Angeles (Pacific)
# America/Anchorage (Alaska)
# America/Adak (Hawaii-Aleutian)
TZ=UTC
# ============================================================================
# Storage Configuration
# ============================================================================
# Base directory for persistent storage
LIBRENMS_DATA_ROOT=/opt/librenms
# ============================================================================
# SNMP Configuration
# ============================================================================
# Default SNMP community string for polling devices
# This is used when adding devices without specifying a community string
SNMP_COMMUNITY=public
# SNMP Version (v1, v2c, v3)
SNMP_VERSION=v2c
# ============================================================================
# Redis Configuration
# ============================================================================
REDIS_HOST=librenms-redis
REDIS_PORT=6379
REDIS_DB=0
# ============================================================================
# Email Configuration (Optional)
# ============================================================================
LIBRENMS_SMTP_HOST=smtp.example.com
LIBRENMS_SMTP_PORT=587
LIBRENMS_SMTP_USER=smtp_user@example.com
LIBRENMS_SMTP_PASSWORD=YOUR_SMTP_PASSWORD_HERE
LIBRENMS_SMTP_FROM=librenms@example.com
# ============================================================================
# Resource Limits Configuration (Optional)
# ============================================================================
# Enable resource limits to prevent containers from consuming excessive CPU/memory
# Recommended for production environments or when running 50+ devices
# Default: false (no limits applied)
# Set to "true" to enable resource limits for all containers
RESOURCE_LIMITS_ENABLED=false
# Per-service CPU quota (percentage of CPU cores)
# Examples: 100% = 1 core, 200% = 2 cores, 50% = 0.5 cores
# Recommended values by device count:
# 10-50 devices: DB=200%, LibreNMS=300%, Redis=100%
# 50-100 devices: DB=400%, LibreNMS=600%, Redis=200%
# 100+ devices: DB=600%, LibreNMS=800%, Redis=300%
# MariaDB Database CPU quota
LIBRENMS_DB_CPU_QUOTA=200%
# LibreNMS Application CPU quota
LIBRENMS_CPU_QUOTA=300%
# Redis Cache CPU quota
LIBRENMS_REDIS_CPU_QUOTA=100%
# SNMP Trap Daemon CPU quota
LIBRENMS_SNMPTRAPD_CPU_QUOTA=50%
# Nginx Reverse Proxy CPU quota (if HTTPS enabled)
LIBRENMS_NGINX_PROXY_CPU_QUOTA=100%
# Per-service Memory limits
# Recommended values by device count:
# 10-50 devices: DB=2G, LibreNMS=4G, Redis=512M
# 50-100 devices: DB=4G, LibreNMS=8G, Redis=1G
# 100+ devices: DB=8G, LibreNMS=16G, Redis=2G
# MariaDB Database memory limit
LIBRENMS_DB_MEMORY_MAX=2G
# LibreNMS Application memory limit
LIBRENMS_MEMORY_MAX=4G
# Dispatcher (polling workers) resource limits
# Dispatcher is CPU-intensive for polling operations
LIBRENMS_DISPATCHER_CPU_QUOTA=300%
LIBRENMS_DISPATCHER_MEMORY_MAX=2G
# Redis Cache memory limit
LIBRENMS_REDIS_MEMORY_MAX=512M
# SNMP Trap Daemon memory limit
LIBRENMS_SNMPTRAPD_MEMORY_MAX=256M
# Nginx Reverse Proxy memory limit (if HTTPS enabled)
LIBRENMS_NGINX_PROXY_MEMORY_MAX=256M
# ============================================================================
# SELinux Configuration
# ============================================================================
# Set to "true" to automatically configure SELinux contexts
CONFIGURE_SELINUX=true