Server backend software for managing remote Linux LXC containers
  • Python 65.5%
  • JavaScript 25.5%
  • HTML 8.2%
  • CSS 0.4%
  • Dockerfile 0.4%
Find a file
Chris Rios 37a08ae753
Add new task regarding Supabase
Added requirement for Supabase support to README.
2026-05-13 11:58:44 -07:00
.github/workflows Add CodeQL analysis workflow configuration 2026-04-17 09:27:17 -07:00
src Implement proper fix for deleting stopped containers 2026-04-28 18:39:39 +00:00
.dockerignore Add Docker files 2026-04-19 20:41:54 +00:00
Dockerfile Remove redundant WORKDIR from Dockerfile 2026-04-19 20:05:31 -07:00
LICENSE Initial commit 2026-01-24 11:19:18 -08:00
README.md Add new task regarding Supabase 2026-05-13 11:58:44 -07:00
requirements.txt Add python requirements.txt file 2026-04-19 20:41:44 +00:00

alugvps-server

Server backend software for managing remote Linux LXC containers

Libraries/Technologies Used

  • Uvicorn
  • FastAPI
  • LXD
  • SQLModel
  • PyJWT
  • python-dotenv
  • aiosmtpd

Things that must be implemented:

  • Implement email-based 2FA
  • Cleaner web user interface (UI/UX)
  • Implement Supabase support to prevent duplicate account creation across different sessions

Setting up a configuration

You will need a .env file to run in the same directory as alugvps-server.py. Here are the environment variables to specify in .env:

  • "secret_key" - Use this command to generate a secret key: openssl rand -hex 32
  • "port" - Connection Port
  • "acc_limit" - Number of Accounts that can have Containers at a Given Time
  • "cpu_limit" - CPU Core Limit for Containers
  • "ram_limit" - RAM Limit for Containers
  • "disk_limit" - Disk Space Limit for Containers
  • "fingerprint_image" - LXC Container Image (See them via lxc image list)
  • "email" - Email where communications will be sent from
  • "email_key" - Email key
  • "smtp_host" - SMTP Host
  • "smtp_port" - SMTP Port

Run via Docker

In the root directory of the source code, run this command:

docker build -t alugvps-server .

Once it has been built, initialize a Docker container with the following command:

docker run \
--mount type=bind,src={LXD Socket Directory},dst={LXD Socket Directory} \
--mount type=bind,src={Host .env File Directory},dst=/usr/local/alugvps-server/.env \
--mount type=bind,src={alugvps.db Database File on Host},dst={/var/lib/alugvps-server/alugvps.db} \
-p {Listening Port on Host}:{Connection Port in .env File} \
--name {Name Your Container} \
alugvps-server

The LXD Socket Directory will vary by system, however for Snap installations, it will be located at /var/snap/lxd/common/lxd/unix.socket. Otherwise, it will be at /var/lib/lxd/unix.socket. So mount whatever the location is in the specified parameters.

To run a container in insecure mode (recommended for testing purposes, run this command):

docker run \
--mount type=bind,src={LXD Socket Directory},dst={LXD Socket Directory} \
--mount type=bind,src={Host .env File Directory},dst=/usr/local/alugvps-server/.env \
--mount type=bind,src={alugvps.db Database File on Host},dst={/var/lib/alugvps-server/alugvps.db} \
-p {Listening Port on Host}:{Connection Port in .env File} \
-e ALUGVPS_SECURE_MODE=0 \
--name {Name Your Container} \
alugvps-server

This command follows the same structure, but adds the parameter -e ALUGVPS_SECURE_MODE=0 to enable insecure mode.