Getting Started with Nauthilus
This guide will help you understand, deploy, and configure Nauthilus for your environment.
What is Nauthilus?
Nauthilus is a universal authentication and authorization platform written in Go. It serves as a central hub for handling various authentication requests from different services such as:
- Mail servers (SMTP, IMAP, POP3)
- Web applications via the native Identity Provider (OIDC + SAML2)
- Custom applications through its flexible API
Key features include:
- Multiple authentication backends (LDAP, Lua scripts)
- Redis-based caching for performance
- Brute force attack protection
- Realtime blackhole list (RBL) checking
- Two-factor authentication support
- Native Identity Provider (OIDC + SAML2)
- Extensibility through Lua scripts
Prerequisites
Before deploying Nauthilus, ensure you have:
- A system with Docker installed (for containerized deployment)
- Redis server (standalone, master-replica, sentinel, or cluster)
- Authentication backend (LDAP server or Lua scripts)
- Basic understanding of YAML configuration
Deployment Options
Docker Deployment (Recommended)
-
Create a Docker Compose File
Create a
docker-compose.ymlfile with Nauthilus and Redis:version: '3'services:nauthilus:image: nauthilus/nauthilus:latestports:- "9443:9443"volumes:- ./config:/etc/nauthilusenvironment:- TZ=UTCdepends_on:- redisredis:image: redis:alpineports:- "6379:6379"volumes:- redis-data:/datacommand: redis-server --appendonly yesvolumes:redis-data: -
Create Configuration Directory
mkdir -p config -
Create Configuration File
Create
config/nauthilus.ymlwith your configuration (see example below). -
Start the Services
docker-compose up -d
Manual Installation
For manual installation, refer to the project documentation or build from source:
- Clone the repository
- Build the binary
- Configure the service
- Set up as a system service
Basic Configuration
Create a minimal nauthilus.yml configuration file:
server:
address: "0.0.0.0:9443" # Listen on all interfaces
log:
level: "info"
redis:
master:
address: "redis:6379" # Use "localhost:6379" for non-Docker setup
password_nonce: "generate-a-random-string-here"
pool_size: 10
positive_cache_ttl: 3600s
negative_cache_ttl: 7200s
backends:
- cache
- ldap # Or "lua" if using Lua backend
# LDAP Backend Configuration (if using LDAP)
ldap:
config:
server_uri: "ldap://ldap-server:389"
bind_dn: "cn=admin,dc=example,dc=com"
bind_pw: "password"
lookup_pool_size: 8
auth_pool_size: 8
search:
- protocol:
- "imap"
- "smtp"
- "default"
cache_name: "mail"
base_dn: "ou=people,dc=example,dc=com"
filter:
user: "(&(objectClass=inetOrgPerson)(uid=%L{user}))"
mapping:
account_field: "uid"
attribute:
- "uid"
- "userPassword"
Configuration Structure
Nauthilus configuration consists of several main sections:
- Server Configuration: Core settings for the server
- Backend Configuration: Authentication backends (LDAP, Lua)
- Feature Configuration: Optional features like RBL checks
- Protocol Configuration: Settings for different protocols
Environment Variables
Some settings can be configured using environment variables. These are typically used for sensitive information like passwords. See the Reference for details.