Wiki > The Lounge
The Lounge is a self-hosted IRC client with a web interface. It stays connected to your IRC networks while your browser is closed, and keeps your chat history. 15450 was randomly generated for this article; you may use any 5-digit port between 10000 and 32767.
Installation
-
Connect to your slot via SSH.
-
Install The Lounge from npm:
npm install --prefix ~/thelounge thelounge@latest -
Make the
theloungecommand available. Skip thePATHline if you've already done this for another program:mkdir -p ~/bin && ln -sf ~/thelounge/node_modules/.bin/thelounge ~/bin/thelounge echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc -
Create The Lounge's data folder with its default config, and set the port:
mkdir -p -m 700 ~/.thelounge cp ~/thelounge/node_modules/thelounge/dist/defaults/config.js ~/.thelounge/config.js sed -i 's/port: 9000,/port: 15450,/' ~/.thelounge/config.js -
Start The Lounge:
screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start -
Create a user account. You'll be asked for a password (use one different from your Whatbox password) and whether to save logs to disk:
thelounge add user -
Visit http://server.whatbox.ca:15450 and log in with the account you just created.
The Lounge runs in private mode by default: nobody can use it without an account. Add more accounts the same way as step 6.
Configuration
The settings live in ~/.thelounge/config.js. Edit it with nano -w ~/.thelounge/config.js, then restart The Lounge for the changes to take effect:
pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start"
screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start
Useful commands (run thelounge --help for the full list):
thelounge list: show all accounts.thelounge reset <name>: set a new password for an account.thelounge edit <name>: open an account's settings file in your editor.thelounge remove <name>: delete an account.thelounge install <package>: install a theme or plugin from npm.
Automatically Restart (optional)
-
Create the restart script:
touch ~/thelounge_restart.cron nano -w ~/thelounge_restart.cron -
Paste the following:
#!/bin/bash if pgrep -fx "node /home/user/thelounge/node_modules/thelounge/index.js start" > /dev/null then echo "The Lounge is running." else echo "The Lounge is not running, starting The Lounge" screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start fi exit -
Press
Ctrl+X, thenY, thenEnterto save. -
Make it executable and open your crontab:
chmod +x ~/thelounge_restart.cron EDITOR=nano crontab -e -
Add these lines at the bottom, then save:
@reboot /home/user/thelounge_restart.cron >/dev/null 2>&1 */5 * * * * /home/user/thelounge_restart.cron >/dev/null 2>&1
HTTPS via Managed Links (optional)
-
On the Manage Links page, select Add a custom app.
-
Enter
theloungeas the name and 15450 as the port, and enable WebSockets. -
Save, then visit https://thelounge.example.box.ca.
-
Once that works, make The Lounge only reachable through the link. In
~/.thelounge/config.js, changehost: undefined,tohost: "127.0.0.1",andreverseProxy: false,toreverseProxy: true,:sed -i 's/host: undefined,/host: "127.0.0.1",/; s/reverseProxy: false,/reverseProxy: true,/' ~/.thelounge/config.js -
Restart The Lounge:
pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start" screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js starthttp://server.whatbox.ca:15450 stops working; https://thelounge.example.box.ca keeps working.
Updating
-
If you set up the restart script, comment out its lines with
EDITOR=nano crontab -eso it doesn't restart The Lounge while you update. -
Stop The Lounge, update it, and start it again:
pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start" npm install --prefix ~/thelounge thelounge@latest screen -dmS thelounge node /home/user/thelounge/node_modules/thelounge/index.js start -
Uncomment the crontab lines.
Your accounts, settings and logs in ~/.thelounge are kept.
Moving from the old instructions
Earlier versions of this article built The Lounge from its git repository into ~/thelounge, with a restart script at ~/.thelounge/cron. Your accounts and settings in ~/.thelounge work with the new install. To switch:
-
Remove the
* * * * * /home/user/.thelounge/cronline withEDITOR=nano crontab -e, and delete the old script:rm ~/.thelounge/cron -
Stop the old install and move it out of the way:
pkill -f "/home/user/.local/bin/thelounge start" mv ~/thelounge ~/thelounge-old rm ~/.local/bin/thelounge -
Follow Installation steps 2, 3 and 5 (skip step 4: your
config.jsalready has your port), then log in with your existing account. -
When everything works, remove the old copy:
rm -r ~/thelounge-old
Uninstalling
-
Remove the restart script lines with
EDITOR=nano crontab -e, and delete the script:rm ~/thelounge_restart.cron -
Stop The Lounge and remove its files. The second line deletes your accounts, settings and logs:
pkill -fx "node /home/user/thelounge/node_modules/thelounge/index.js start" rm -r ~/thelounge ~/bin/thelounge rm -r ~/.thelounge -
If you created a Managed Link, delete it on the Manage Links page.
Troubleshooting
- Forgot your password: run
thelounge reset <name>and log in with the new password. - The page loads but stays on "Connecting": if you use a Managed Link, make sure WebSockets is enabled on it.
EADDRINUSEin the screen session (screen -r thelounge, detach withCtrl+AthenD): another program is using the port. Pick a different port, changeport:in~/.thelounge/config.js, and start The Lounge again.thelounge: command not found: runsource ~/.bashrc, or log out and back in.