How to run Lite Queen on a Ubuntu server with Docker

Ready to get Lite Queen up and running on your Ubuntu server using Docker? You're in the right place! This guide will walk you through the steps to do just that, keeping things simple and straightforward.

  1. Get Your Hands on Lite Queen: First things first, after purchasing Lite Queen, download the executable that matches your system.

  2. Prep Your Dockerfile: In the same directory as your Lite Queen executable, whip up a Dockerfile. Here's a quick template to get you started:

    FROM alpine:latest
    
    
    WORKDIR /home/litequeen
    
    # Use --build-arg to specify the path of the litequeen executable during build
    ARG LITEQUEEN_EXECUTABLE
    
    COPY ${LITEQUEEN_EXECUTABLE} ./litequeen
    RUN chmod +x litequeen
    
    
    CMD [ "./litequeen", "--hostname", "0.0.0.0", "--port", "8000" ]
    
    
  3. Build That Image: Time to build your Docker image. Run the following command, and feel free to tag it as you like:

    docker build --build-arg LITEQUEEN_EXECUTABLE=lite-queen-linux-amd64-2024-04-16 --tag litequeen .
    

    Once built, push the image to your preferred registry.

  1. Run Lite Queen: With your image ready, let's get Lite Queen running:

    docker run -d -p 8080:8000 -v /srv/www:/srv litequeen
    

    The -d flag is used to run the container in detached mode, meaning it runs in the background.

    We're mapping port 8080 on our server to port 8000 inside the container, where Lite Queen is listening.

    The -v /srv/www:/srv links your host's database locations (e.g., /srv/www) with the container's (/srv). This setup allows you to manage databases inside the container using paths like /srv/path-to_database. Change /srv/www with the location of the database files on your system.

  2. Access Lite Queen: Head over to http://localhost:8080, and voilà, Lite Queen should greet you. To make it accessible via a domain, with some added security, let's set up Caddy(you're free to use any another webserver like Nginx, etc):

    litequeen.internal.example.com {
    
        @blocked {
            not remote_ip xx.xx.xx.xx # Whitelisted IP Address
        }
        respond @blocked "Not allowed" 403
    
        basicauth * { 
            # Password hashed with Caddy's hash-password command
            testing $2a$14$0EaqE/lqNro14adPf/c2COOdqfXukT5hXIS9.ZwRj0FMBQcWTYxR.
        }
    
        reverse_proxy :8080
    }
    
    

    Now, Lite Queen is not only up and running but also secure and accessible at https://litequeen.internal.example.com. And there you have it! A straightforward guide to getting Lite Queen running on your Ubuntu server with Docker. Happy hosting!