The Chinese version of this installation guide is available at INSTALL.zh_CN.md.
To install LBBS on Linux (e.g., Debian 13, CentOS Stream 10), please perform the following steps:
Follow the instructions in leafok_bbs README.md to initialize the database structure shared by both the web and telnet versions.
It is highly recommended to complete the web version configuration steps first and ensure those features work properly.
- gcc >= 13.3
- autoconf >= 2.68
- automake >= 1.16
- php >= 8.2
- mysql >= 8.4
Debian / Ubuntu:
sudo apt-get install -y libssh-dev libsystemd-devCentOS / RHEL:
sudo dnf install -y libssh-devel systemd-develMSYS2 with MinGW-w64 toolchain:
pacman -S --needed msys2-runtime-devel libssh libssh-devel pcre2-devel mingw-w64-x86_64-libiconv mingw-w64-x86_64-libmariadbclientExtract the source files from a tarball or export from GitHub.
Run the following command to set up the autoconf/automake environment:
autoreconf --install --forceexport LBBS_HOME_DIR=/usr/local/lbbsFor Linux:
./configure --prefix=$LBBS_HOME_DIRFor MSYS2 with MinGW-w64 toolchain:
./configure --prefix=$LBBS_HOME_DIR --disable-shared PKG_CONFIG_PATH=/mingw64/lib/pkgconfig/makesudo useradd bbssudo make install
chown -R bbs:bbs $LBBS_HOME_DIRDefault configuration files are saved as *.default. Copy and rename them first:
cd $LBBS_HOME_DIR
cp conf/bbsd.conf.default conf/bbsd.conf
cp conf/bbsnet.conf.default conf/bbsnet.conf
cp conf/badwords.conf.default conf/badwords.conf
cp utils/conf/db_conn.conf.php.default utils/conf/db_conn.conf.phpThen edit each file to match your environment:
Key settings to adjust:
db_host,db_username,db_password,db_database: MySQL connection detailsbbs_server,bbs_port,bbs_ssh_port: Network settingsbbs_name: Your BBS namebbs_max_client: Maximum concurrent connections (adjust based on server capacity)
Set the database connection parameters:
$DB_hostname,$DB_username,$DB_password,$DB_database
Review and customize as needed for your BBS policies.
Copy the MySQL server's CA certificate file to $LBBS_HOME_DIR/conf/ca_cert.pem.
Run the following scripts to generate menu configuration files with section data:
sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_section_menu.php
sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_ex_list.php
sudo -u bbs php $LBBS_HOME_DIR/utils/bin/gen_top.phpGenerate SSH host keys for the SSH server component. The -N "" flag sets an empty passphrase for the keys (required for automated service startup).
ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key
ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key
ssh-keygen -t ecdsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ecdsa_keysudo -u bbs $LBBS_HOME_DIR/bin/bbsdCreate your own /usr/lib/systemd/system/lbbs.service from the sample at conf/lbbs.service, and make any necessary changes.
Reload daemon configuration and start the service.
Create your own /etc/logrotate.d/lbbs from the sample at conf/lbbs.logrotate, and make any necessary changes.
Restart the logrotate service.
In case of unexpected failure or improper operation resulting in abnormal termination of the LBBS process, manual cleanup of shared memory/semaphore might be required before relaunching the process.
- After a crash or force-kill of the
bbsdprocess - If
bbsdfails to start with "shared memory already exists" errors - When
ipcsshows resources owned by userbbs
First, check for any remaining shared memory segments or semaphores:
sudo -u bbs ipcsLook for entries in the "SHM" (shared memory) and "SEM" (semaphore) sections where the "OWNER" is bbs.
If resources exist, remove them with:
sudo -u bbs ipcrm -aThis removes all shared memory and semaphore resources accessible to the bbs user.
For containerized deployment, LBBS provides Docker support.
To build the Docker image from source code:
docker compose up --build -dTo use pre-built images from Docker Hub:
docker compose pull
docker compose up -dWhen using Docker, you still need to configure LBBS appropriately:
-
Configuration Files: Create and customize the configuration files as described in Step 6.
-
Database Connection: Ensure
db_conn.conf.phppoints to your MySQL server (which should be accessible from the container). -
Port Mapping: By default, Docker Compose maps:
- SSH port: 2322 → 2322 (container)
- Telnet port: 2323 → 2323 (container)
Adjust these in
docker-compose.ymlif needed. -
Persistent Data: The
data/andconf/directories are mounted as volumes for persistence.
- Start:
docker compose up -d - Stop:
docker compose down - View logs:
docker compose logs -f - Restart:
docker compose restart
For more details, refer to the docker-compose.yml file and Docker documentation.