These instructions are written assuming you're running Linux, but the Docker setup process should be about the same on macOS or Windows.
Drasl is an HTTP server that listens on port 25585 (customize with the ListenAddress
option). You'll want to put it behind a reverse proxy for HTTPS.
On most systems, Docker is the easiest way to host Drasl:
-
In any working directory, clone the repository (you can delete it later if you want):
git clone https://github.com/unmojang/drasl.git
-
Copy the
docker
example to wherever you want to store Drasl's data. I like/srv/drasl
:sudo cp -RTi ./drasl/example/docker /srv/drasl
-
cd /srv/drasl
-
Fill out
config/config.toml
according to one of the examples in doc/recipes.md. -
docker compose up -d
-
Set up an reverse proxy (using e.g. Caddy or nginx) from your base URL (e.g.
https://drasl.example.com
) tohttp://localhost:25585
.
Note: when Drasl updates, you will have to manually pull the most recent version:
cd /srv/drasl
docker compose pull && docker compose up -d
If you don't already have a web server to use as a reverse proxy, you can use the docker-caddy
example instead which sets up a Caddy server with automatic TLS:
-
In any directory, clone the repository (you can delete it later if you want):
git clone https://github.com/unmojang/drasl.git
-
Copy the
docker-caddy
example to wherever you want to store Drasl's data:sudo cp -RTi ./drasl/example/docker-caddy /srv/drasl
-
cd /srv/drasl
-
Fill out
Caddyfile
-
Fill out
config/config.toml
according to one of the examples in doc/recipes.md. -
docker compose up -d
Note: when Drasl updates, you will have to manually pull the most recent version:
cd /srv/drasl
docker compose pull && docker compose up -d
Drasl is available in the AUR as drasl-git
:
yay -Syu drasl-git # (or whatever AUR helper is hot right now)
- Fill out
/etc/drasl/config.toml
according to one of the examples in doc/recipes.md. sudo systemctl enable --now drasl
For NixOS users, the project's flake provides a NixOS module. This example /etc/nixos/flake.nix
shows how you might include it in your configuration:
{
description = "Example Drasl NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
drasl = {
type = "git";
url = "https://github.com/unmojang/drasl.git";
ref = "master";
};
};
outputs = {self, nixpkgs, drasl, ...}@inputs: {
nixosConfigurations = {
"myhostname" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
drasl.nixosModules.drasl
./configuration.nix
];
};
};
};
}
Then, in your configuration.nix
:
services.drasl = {
enable = true;
settings = {
Domain = "drasl.example.com";
BaseURL = "https://drasl.example.com";
DefaultAdmins = [ "" ];
};
};
See doc/configuration.md for documentation of the options in services.drasl.settings
.
This is a more declarative version of the Docker setup from above.
-
In any directory, clone the repository (you can delete it later if you want):
git clone https://github.com/unmojang/drasl.git
-
Copy the
docker
example to wherever you want to store Drasl's data:sudo cp -RTi ./drasl/example/docker /srv/drasl
-
cd /srv/drasl
-
Fill out
config/config.toml
according to one of the examples in doc/recipes.md. -
Add the following to your
/etc/nixos/configuration.nix
and thensudo nixos-rebuild switch
:virtualisation.oci-containers = { containers.drasl = { volumes = [ "/srv/drasl/config:/etc/drasl" "/srv/drasl/data:/var/lib/drasl" ]; image = "unmojang/drasl"; ports = [ "127.0.0.1:25585:25585" ]; extraOptions = [ "--pull=newer" ]; # Optional: auto-update }; };
-
Install build dependencies:
sudo apt install make golang gcc nodejs npm # Debian sudo dnf install make go gcc nodejs npm # Fedora sudo pacman -S make go gcc nodejs npm # Arch Linux
-
Clone the repository:
git clone [email protected]:unmojang/drasl.git # SSH git clone https://github.com/unmojang/drasl.git # HTTPS cd drasl
-
sudo make install
-
Create
/etc/drasl/config.toml
and fill it out according to one of the examples in doc/recipes.md. -
Install, enable, and start the provided systemd service:
sudo install -m 644 ./example/drasl.service /etc/systemd/system/drasl.service sudo systemctl daemon-reload sudo systemctl enable --now drasl.service
Consider setting up Litestream and/or some other kind of backup system if you're running Drasl in production.
Continue to usage.md.