2024-08-17 04:55:01 +07:00
# Garage Web UI
2024-08-14 15:36:25 +07:00
2024-08-17 04:55:01 +07:00
[](misc/img/garage-webui.png)
2024-08-14 15:36:25 +07:00
2024-08-17 04:55:01 +07:00
A simple admin web UI for [Garage ](https://garagehq.deuxfleurs.fr/ ), a self-hosted, S3-compatible, distributed object storage service.
2024-08-14 15:36:25 +07:00
2024-08-17 04:55:01 +07:00
[ [Screenshots ](misc/SCREENSHOTS.md ) | [Install Garage ](https://garagehq.deuxfleurs.fr/documentation/quick-start/ ) | [Garage Git ](https://git.deuxfleurs.fr/Deuxfleurs/garage ) ]
2024-08-14 15:36:25 +07:00
2024-08-19 02:28:25 +07:00
## Features
- Garage health status
- Cluster & layout management
- Create, update, or view bucket information
- Integrated objects/bucket browser
- Create & assign access keys
2024-08-17 04:55:01 +07:00
## Installation
2024-08-14 15:36:25 +07:00
2024-08-18 08:10:20 +07:00
The Garage Web UI is available as a single executable binary and docker image. You can install it using the command line or with Docker Compose.
2024-08-14 15:36:25 +07:00
2024-08-17 04:55:01 +07:00
### Docker CLI
2024-08-14 15:36:25 +07:00
2024-08-17 04:55:01 +07:00
```sh
2025-07-31 14:14:21 -04:00
docker run -p 3909:3909 -v ./garage.toml:/etc/garage.toml:ro --restart unless-stopped --name garage-webui khairul169/garage-webui:latest
2024-08-14 15:36:25 +07:00
```
2024-08-17 04:55:01 +07:00
### Docker Compose
If you install Garage using Docker, you can install this web UI alongside Garage as follows:
```yml
services:
garage:
2024-10-04 17:15:03 +00:00
image: dxflrs/garage:v1.0.1
2024-08-17 04:55:01 +07:00
container_name: garage
volumes:
- ./garage.toml:/etc/garage.toml
- ./meta:/var/lib/garage/meta
- ./data:/var/lib/garage/data
restart: unless-stopped
2024-11-18 10:18:03 +00:00
ports:
2025-02-01 02:56:52 +00:00
- 3900:3900
- 3901:3901
2025-03-19 06:06:34 +07:00
- 3902:3902
2025-02-01 02:56:52 +00:00
- 3903:3903
2024-08-17 04:55:01 +07:00
webui:
image: khairul169/garage-webui:latest
container_name: garage-webui
restart: unless-stopped
volumes:
2024-08-18 06:33:58 +07:00
- ./garage.toml:/etc/garage.toml:ro
2024-08-17 04:55:01 +07:00
ports:
- 3909:3909
2024-11-18 10:18:03 +00:00
environment:
API_BASE_URL: "http://garage:3903"
S3_ENDPOINT_URL: "http://garage:3900"
2024-08-17 04:55:01 +07:00
```
2024-08-18 08:10:20 +07:00
### Without Docker
Get the latest binary from the [release page ](https://github.com/khairul169/garage-webui/releases/latest ) according to your OS architecture. For example:
```sh
2025-07-31 14:14:21 -04:00
wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.9/garage-webui-v1.0.9-linux-amd64
chmod +x garage-webui
sudo cp garage-webui /usr/local/bin
2024-08-18 08:10:20 +07:00
```
Run the program with specified `garage.toml` config path.
```sh
2025-07-31 14:14:21 -04:00
CONFIG_PATH=./garage.toml garage-webui
2024-08-18 08:10:20 +07:00
```
If you want to run the program at startup, you may want to create a systemd service.
```sh
2025-07-31 14:14:21 -04:00
sudo nano /etc/systemd/system/garage-webui.service
2024-08-18 08:10:20 +07:00
```
```
[Unit]
Description=Garage Web UI
After=network.target
[Service]
Environment="PORT=3919"
Environment="CONFIG_PATH=/etc/garage.toml"
ExecStart=/usr/local/bin/garage-webui
Restart=always
[Install]
WantedBy=default.target
```
Then reload and start the garage-webui service.
```sh
2025-07-31 14:14:21 -04:00
sudo systemctl daemon-reload
sudo systemctl enable --now garage-webui
2024-08-18 08:10:20 +07:00
```
2024-08-17 04:55:01 +07:00
### Configuration
To simplify installation, the Garage Web UI uses values from the Garage configuration, such as `rpc_public_addr` , `admin.admin_token` , `s3_web.root_domain` , etc.
Example content of `config.toml` :
```toml
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "sqlite"
metadata_auto_snapshot_interval = "6h"
replication_factor = 3
compression_level = 2
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "localhost:3901" # Required
rpc_secret = "YOUR_RPC_SECRET_HERE"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.domain.com"
[s3_web] # Optional, if you want to expose bucket as web
bind_addr = "[::]:3902"
root_domain = ".web.domain.com"
index = "index.html"
[admin] # Required
api_bind_addr = "[::]:3903"
admin_token = "YOUR_ADMIN_TOKEN_HERE"
metrics_token = "YOUR_METRICS_TOKEN_HERE"
```
2025-03-19 06:06:34 +07:00
However, if it fails to load, you can set `API_BASE_URL` & `API_ADMIN_KEY` environment variables instead.
### Environment Variables
Configurable envs:
2024-08-17 04:55:01 +07:00
- `CONFIG_PATH` : Path to the Garage `config.toml` file. Defaults to `/etc/garage.toml` .
2025-03-19 05:32:08 +07:00
- `BASE_PATH` : Base path or prefix for Web UI.
2024-08-17 04:55:01 +07:00
- `API_BASE_URL` : Garage admin API endpoint URL.
- `API_ADMIN_KEY` : Admin API key.
2024-10-14 00:21:30 +00:00
- `S3_REGION` : S3 Region.
- `S3_ENDPOINT_URL` : S3 Endpoint url.
2024-08-17 04:55:01 +07:00
2025-03-01 23:22:18 +07:00
### Authentication
2025-03-19 05:32:08 +07:00
Enable authentication by setting the `AUTH_USER_PASS` environment variable in the format `username:password_hash` , where `password_hash` is a bcrypt hash of the password.
Generate the username and password hash using the following command:
2025-03-01 23:22:18 +07:00
```bash
htpasswd -nbBC 10 "YOUR_USERNAME" "YOUR_PASSWORD"
```
> If command 'htpasswd' is not found, install `apache2-utils` using your package manager.
Then update your `docker-compose.yml` :
```yml
webui:
....
environment:
AUTH_USER_PASS: "username:$2y$10$DSTi9o..."
```
2024-08-17 04:55:01 +07:00
### Running
Once your instance of Garage Web UI is started, you can open the web UI at http://your-ip:3909. You can place it behind a reverse proxy to secure it with SSL.
## Development
2024-08-18 06:33:58 +07:00
This project is bootstrapped using TypeScript & React for the UI, and Go for backend. If you want to build it yourself or add additional features, follow these steps:
2024-08-17 04:55:01 +07:00
### Setup
```sh
2025-07-31 14:14:21 -04:00
git clone https://github.com/khairul169/garage-webui.git
cd garage-webui & & pnpm install
cd backend & & pnpm install & & cd ..
2024-08-17 04:55:01 +07:00
```
2025-07-31 14:11:22 -04:00
### Development with Docker
For development with Docker, a `docker-compose.dev.yml` file is provided with 4 Garage instances:
```sh
# Create necessary directories for Garage data
2025-07-31 14:14:21 -04:00
mkdir -p dev.local/data-garage/meta dev.local/data-garage/data
mkdir -p dev.local/data-garage2/meta dev.local/data-garage2/data
mkdir -p dev.local/data-garage3/meta dev.local/data-garage3/data
mkdir -p dev.local/data-garage4/meta dev.local/data-garage4/data
2025-07-31 14:11:22 -04:00
2025-07-31 14:40:57 -04:00
# Generate a secure RPC secret using OpenSSL
# The rpc_secret is used to secure communication between Garage nodes
RPC_SECRET=$(openssl rand -hex 32)
echo "Generated RPC secret: $RPC_SECRET"
2025-07-31 14:11:22 -04:00
# Copy the template configuration files and replace CONTAINER_NAME with the actual container name
2025-07-31 14:40:57 -04:00
# Using sed with empty string after -i for macOS compatibility
cp garage.toml.template dev.local/garage.toml & & sed -i '' "s/CONTAINER_NAME/garage/g; s/dev-garage-secret/$RPC_SECRET/g" dev.local/garage.toml
cp garage.toml.template dev.local/garage2.toml & & sed -i '' "s/CONTAINER_NAME/garage2/g; s/dev-garage-secret/$RPC_SECRET/g" dev.local/garage2.toml
cp garage.toml.template dev.local/garage3.toml & & sed -i '' "s/CONTAINER_NAME/garage3/g; s/dev-garage-secret/$RPC_SECRET/g" dev.local/garage3.toml
cp garage.toml.template dev.local/garage4.toml & & sed -i '' "s/CONTAINER_NAME/garage4/g; s/dev-garage-secret/$RPC_SECRET/g" dev.local/garage4.toml
2025-07-31 14:11:22 -04:00
# Setup environment variables
2025-07-31 14:14:21 -04:00
cp .env.example .env
cp backend/.env.example backend/.env
2025-07-31 14:11:22 -04:00
# Start the Garage containers
2025-07-31 14:14:21 -04:00
docker-compose -f docker-compose.dev.yml up -d
2025-07-31 14:11:22 -04:00
```