Blazing Fast
Written in pure assembly language, AsmBB delivers page processing times of just 3-80 milliseconds.
AsmBB is a high-performance web forum engine written entirely in assembly language using FlatAssembler (FASM). Renowned for its extreme efficiency and minimal resource usage, AsmBB can serve massive amounts of visitors on even the most modest hardware. With page processing times measured in milliseconds and a self-contained architecture using SQLite for data storage, AsmBB represents the ultimate in lightweight forum software.
Built for speed and simplicity, AsmBB uses the FastCGI interface to communicate with web servers and requires no external dependencies beyond a web server with FastCGI support. This guide walks you through deploying AsmBB on Klutch.sh using Docker with Nginx as the web server.
Blazing Fast
Written in pure assembly language, AsmBB delivers page processing times of just 3-80 milliseconds.
Minimal Resources
Runs efficiently on the cheapest VPS or shared hosting, handling thousands of visitors without lag.
Self-Contained
Uses embedded SQLite database with no external dependencies—everything runs in a single lightweight process.
Secure
Aggressive testing and minimal attack surface result in excellent security with optional database encryption.
Before deploying AsmBB on Klutch.sh, ensure you have the following:
AsmBB provides a comprehensive feature set despite its minimal footprint:
AsmBB uses a FastCGI architecture where:
┌─────────────────────────────────────────────────────────────────────┐│ Client Browser │└──────────────────────────────┬──────────────────────────────────────┘ │ HTTP/HTTPS ▼┌─────────────────────────────────────────────────────────────────────┐│ Nginx Web Server ││ (Reverse Proxy + FastCGI) │└──────────────────────────────┬──────────────────────────────────────┘ │ FastCGI (Unix Socket) ▼┌─────────────────────────────────────────────────────────────────────┐│ AsmBB Engine ││ (Assembly Binary + SQLite) ││ ┌──────────────────────────────────────────────────────────────┐ ││ │ board.sqlite │ ││ │ (Forum Database) │ ││ └──────────────────────────────────────────────────────────────┘ │└─────────────────────────────────────────────────────────────────────┘Create the following structure for your AsmBB deployment:
asmbb-deploy/├── Dockerfile├── nginx.conf├── supervisord.conf├── start.sh└── README.mdAsmBB requires a custom Dockerfile that sets up both Nginx and the AsmBB engine. Create a Dockerfile in your project root:
FROM debian:bullseye-slim
# Install dependenciesRUN apt-get update && apt-get install -y \ nginx \ supervisor \ wget \ curl \ ca-certificates \ && rm -rf /var/lib/apt/lists/*
# Create AsmBB directoryRUN mkdir -p /var/www/asmbb
# Download and extract AsmBBWORKDIR /var/www/asmbbRUN wget -q https://asm32.info/fossil/repo/asmbb/doc/trunk/install/asmbb.tar.gz \ && tar -xzf asmbb.tar.gz \ && mv asmbb/* ./ \ && rm -rf asmbb asmbb.tar.gz \ && rm -f *.txt lighttpd.conf .htaccess
# Set proper permissionsRUN chown -R www-data:www-data /var/www/asmbb \ && chmod +x /var/www/asmbb/engine
# Copy configuration filesCOPY nginx.conf /etc/nginx/nginx.confCOPY supervisord.conf /etc/supervisor/conf.d/supervisord.confCOPY start.sh /start.shRUN chmod +x /start.sh
# Create necessary directoriesRUN mkdir -p /var/log/nginx /var/log/supervisor /run/nginx
# Expose the web portEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD curl -f http://localhost:8080/ || exit 1
CMD ["/start.sh"]Create an nginx.conf file for the FastCGI configuration:
user www-data;worker_processes auto;pid /run/nginx.pid;error_log /var/log/nginx/error.log;
events { worker_connections 1024; use epoll; multi_accept on;}
http { include /etc/nginx/mime.types; default_type application/octet-stream;
# Logging access_log /var/log/nginx/access.log;
# Performance optimizations sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048;
# Gzip compression gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
server { listen 8080; server_name _;
root /var/www/asmbb;
# Serve static files directly location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d; add_header Cache-Control "public, immutable"; try_files $uri =404; }
# FastCGI to AsmBB engine location / { fastcgi_pass unix:/var/www/asmbb/engine.sock; include fastcgi_params;
# FastCGI parameters fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SERVER_NAME $host;
# Timeouts fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; }
# Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; }}Create a supervisord.conf file to manage both Nginx and the AsmBB engine:
[supervisord]nodaemon=trueuser=rootlogfile=/var/log/supervisor/supervisord.logpidfile=/var/run/supervisord.pidchildlogdir=/var/log/supervisor
[program:asmbb]command=/var/www/asmbb/enginedirectory=/var/www/asmbbuser=www-dataautostart=trueautorestart=truestartsecs=5startretries=3stdout_logfile=/var/log/supervisor/asmbb.logstderr_logfile=/var/log/supervisor/asmbb_error.logpriority=100
[program:nginx]command=/usr/sbin/nginx -g "daemon off;"autostart=trueautorestart=truestartsecs=5startretries=3stdout_logfile=/var/log/supervisor/nginx.logstderr_logfile=/var/log/supervisor/nginx_error.logpriority=200Create a start.sh script to initialize the environment:
#!/bin/bashset -e
# Set ownershipchown -R www-data:www-data /var/www/asmbb
# Remove stale socket if existsrm -f /var/www/asmbb/engine.sock
# Start supervisor (which manages nginx and asmbb)exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.confCreate a GitHub repository
Create a new repository for your AsmBB deployment:
mkdir asmbb-deploycd asmbb-deploygit initAdd all configuration files
Create all the files described above:
Dockerfilenginx.confsupervisord.confstart.shPush to GitHub
Commit and push your repository:
git add .git commit -m "Initial AsmBB deployment configuration"git branch -M maingit remote add origin https://github.com/yourusername/asmbb-deploy.gitgit push -u origin mainConnect to Klutch.sh
Navigate to klutch.sh/app and sign in with your GitHub account. Click New Project to begin the deployment process.
Select your repository
Choose the GitHub repository containing your AsmBB Dockerfile. Klutch.sh will automatically detect the Dockerfile in your project root.
Set the internal port
Configure the internal port to 8080 (the port Nginx listens on in our configuration).
Add persistent storage
AsmBB stores all forum data in a SQLite database. Add a persistent volume to preserve your forum data:
| Mount Path | Size |
|---|---|
/var/www/asmbb | 1 GB+ |
Deploy your application
Click Deploy to start the deployment process. Once complete, your AsmBB forum will be accessible at https://example-app.klutch.sh.
When you first access your AsmBB forum, you’ll be greeted with the setup wizard:
Access your forum
Navigate to your deployed AsmBB URL (e.g., https://example-app.klutch.sh). The admin setup dialog will appear automatically.
Create the administrator account
Fill in the administrator registration form:
Configure forum settings
After creating the admin account, access the settings panel at /!settings to configure:
Access the settings panel at https://example-app.klutch.sh/!settings to configure:
| Setting | Description | Example |
|---|---|---|
host | Your forum’s domain name | example-app.klutch.sh |
forum_title | Title displayed in browser | My AsmBB Forum |
smtp_addr | SMTP server address | smtp.gmail.com |
smtp_port | SMTP server port | 587 |
smtp_user | Email sender username | noreply |
page_length | Posts per page | 20 |
AsmBB uses a bitmask-based permission system:
| Permission | Value | Description |
|---|---|---|
permLogin | 1 | Ability to log in |
permPost | 4 | Post in existing threads |
permThreadStart | 8 | Create new threads |
permEditOwn | 16 | Edit own posts |
permEditAll | 32 | Edit all posts |
permDelOwn | 64 | Delete own posts |
permDelAll | 128 | Delete all posts |
permAdmin | 2147483648 | Administrator access |
Default user permissions are typically set to 29 (login + post + thread start + edit own).
For advanced administration, access the SQLite console at /!sqlite (admin only). Example queries:
-- View all forum parametersSELECT * FROM Params;
-- Update a parameterINSERT OR REPLACE INTO Params VALUES ('forum_title', 'My Awesome Forum');
-- View user countSELECT COUNT(*) FROM Users;
-- List recent threadsSELECT * FROM Threads ORDER BY id DESC LIMIT 10;AsmBB uses a template system located in the /templates directory. Key template files:
| Template | Purpose |
|---|---|
main_html_start.tpl | HTML header for all pages |
main_html_end.tpl | HTML footer for all pages |
thread_info.tpl | Thread listing appearance |
post_view.tpl | Individual post display |
form_login.tpl | Login form |
form_register.tpl | Registration form |
Templates support special commands in square brackets:
<!-- Display the forum title --><title>[special:title]</title>
<!-- Show current user -->Welcome, [special:username]!
<!-- Check if user is admin -->[case:[special:isadmin]|User|Admin]
<!-- Display processing time -->Page rendered in [special:timestamp] msAsmBB uses MiniMag, a Markdown-like syntax for formatting posts:
| Syntax | Result |
|---|---|
*bold* | bold |
/italic/ | italic |
_underline_ | underline |
-strikethrough- | |
[link text|url] | Hyperlink |
[image.jpg] | Image |
#header | Header |
##subheader | Subheader |
`code` | Inline code |
>>>quote | Blockquote |
To use a custom domain with your AsmBB deployment:
Add your domain in Klutch.sh
Navigate to your project settings and add your custom domain (e.g., forum.yourdomain.com).
Configure DNS records
Add a CNAME record pointing to your Klutch.sh deployment:
| Type | Name | Value |
|---|---|---|
| CNAME | forum | example-app.klutch.sh |
Update forum settings
Update the host parameter in AsmBB settings:
INSERT OR REPLACE INTO Params VALUES ('host', 'forum.yourdomain.com');Wait for SSL provisioning
Klutch.sh automatically provisions SSL certificates for custom domains.
For local development and testing:
services: asmbb: build: . ports: - "8080:8080" volumes: - asmbb-data:/var/www/asmbb restart: unless-stopped
volumes: asmbb-data:Start the local environment:
docker compose up -dAccess AsmBB at http://localhost:8080.
AsmBB is already extremely optimized, but you can further enhance performance:
Add caching for static assets in nginx.conf:
# Browser caching for static fileslocation ~* \.(css|js|png|jpg|jpeg|gif|ico|svg)$ { expires 30d; add_header Cache-Control "public, immutable"; add_header Vary Accept-Encoding;}Periodically optimize the SQLite database:
VACUUM;ANALYZE;The forum data is stored in /var/www/asmbb/board.sqlite. To backup:
board.sqlite fileboard.sqlite with your backupThis usually means the AsmBB engine isn’t running or the socket isn’t created:
/var/log/supervisor/asmbb_error.log/var/www/asmbb/engine.sockVerify SMTP settings in the forum configuration:
/!settings as adminsmtp_addr, smtp_port, and smtp_user are correctIf you see database locked errors:
AsmBB is designed to be fast, but if performance degrades:
ls -la board.sqliteVACUUM and ANALYZE in SQLite consoleAfter deploying AsmBB, consider: