A beautifully simple, self-hosted sharing service.
- Head to the releases page.
- Download the latest release for your platform.
- Extract the archive to somewhere like
/opt/spectra. - Go to the directory where you extracted the archive.
- Run
./Spectra initto generate the configuration file. - Edit the configuration file to your liking.
- Run
./Spectrato start the server.
Before deploying your own instance, you can try Spectra on the demo site hosted by RLt. The demo site uses Cloudflare Turnstile to prevent abuse. You can disable it when deploying your own instance.
You can switch languages by clicking the globe icon in the top-right corner. Spectra currently supports the following languages:
- 简体中文
- English
Contributions of additional translations are welcome.
On Linux distros, you can use the systemd unit file to manage the service. Spectra provides a command for generating the unit file.
sudo ./Spectra systemd
sudo systemctl daemon-reloadAfter that you can enable and start the service:
sudo systemctl enable --now spectraImportant
For security reasons, it is highly recommended to run the server as a non-root user like spectra.
This is not required and can be ignored, but there will be risks.
You can add spectra user like this:
sudo useradd -M -U spectra
# don't forget to replace /opt/spectra with your own path
sudo chown -R spectra:spectra /opt/spectraAnd then uncomment the User line in the unit file created above:
- # User=spectra
+ User=spectraThe public Quay image uses
Alpine Linux and is published as quay.io/lingrottin/spectra:latest. It
contains the prebuilt static musl binary and a configuration that listens on
0.0.0.0:3000.
Run it with Podman and a named volume so the SQLite database and uploaded files persist:
podman run --detach \
--name spectra \
--publish 3000:3000 \
--volume spectra-data:/var/lib/spectra/data \
quay.io/lingrottin/spectra:latestOpen http://127.0.0.1:3000. Persistent application data is stored in
/var/lib/spectra/data.
To build the image locally, first build the frontend and the static musl
binary at target/x86_64-unknown-linux-musl/release/Spectra, then run:
podman build --tag spectra:latest .To use a host directory instead of a named volume on SELinux-enabled systems:
mkdir -p spectra-data
podman run --detach \
--name spectra \
--publish 3000:3000 \
--volume ./spectra-data:/var/lib/spectra/data:Z,U \
quay.io/lingrottin/spectra:latestSpectra itself does not support SSL. Using a reverse proxy software like Nginx is recommended.
Sample configuration block for nginx:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name spectra.example.com;
ssl_certificate "/path/to/cert.pem";
ssl_certificate_key "/path/to/key.pem";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers PROFILE=SYSTEM;
ssl_prefer_server_ciphers on;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:3000/;
client_max_body_size 1024M;
}
}Before continuing, make sure you have these installed:
- Rust toolchain
- Node.js & pnpm (it would be better if your pnpm is installed using npm)
- Windows Terminal
Then create a .env under the root directory.
Write the content below:
DATABASE_URL=sqlite:./data.dbYou can name the database file whatever you want, but make sure it is an SQLite URL.
And run the command below:
pnpm install
cargo install sqlx-cli
sqlx database setupFinally run the command below to run the project under development mode:
pnpm devCargo might fail to locate the cmake binary on Windows.
You can find its path by running the command below in "Developer PowerShell for VS 20xx":
where.exe cmakeThen add the path to spectra/.cargo/config.toml like below:
[env]
CMAKE = "C:\\path\\to\\cmake.exe"