Quick Setup
ShotShare is meant to be extremely easy to self host. Below is a sample deployment using Docker.
Example Deployment with Docker
- Create a directory for ShotShare:
sudo mkdir /shotshare
- Create persistent files:
sudo touch /shotshare/.env /shotshare/database.sqlite
- Ensure the user/group 82 (
www-data
user in docker container) own the.env
anddatabase.sqlite
files
sudo chown 82:82 /shotshare/.env /shotshare/database.sqlite
You may wish to customize environment variables (such as the HOST
) before running this command, see below for a list of environment variables.
If you used ShotShare before 1.5.1, the "database" mount has changed to a file bind, you will need to manually migrate your database.sqlite
file to use these new commands.
Run in HTTPS mode (recommended for production)
This will use Caddy's Automatic HTTPs setup generate SSL certificates, handle renewals, and automagically redirect your visitors to HTTPS. For most scenarios, this is the "preferred" installation method.
docker run \
-p 80:80 \
-p 443:443 \
-e HOST=localhost \
-e FEATURE_UUID_ROUTES=true \
-v shotshare_caddy_data:/data/caddy \
-v shotshare_caddy_config:/config/caddy \
-v shotshare_data:/app/storage \
--mount type=bind,source=/shotshare/database.sqlite,target=/app/database/database.sqlite \
--mount type=bind,source=/shotshare/.env,target=/app/.env \
-d \
--restart unless-stopped \
--name shotshare \
mdshack/shotshare:latest
Run in HTTP mode
This will not issue any SSL and will just serve over HTTP. This may be useful if you plan to front ShotShare with your own reverse proxy.
If you plan to force HTTPS before it gets to ShotShare, you will also need to force ShotShare to utilize HTTPS links, you may do so by adding -e FORCE_HTTPS=true
.
docker run \
-p 80:80 \
-e HOST=":80" \
-e FEATURE_UUID_ROUTES=true \
-v shotshare_data:/app/storage \
--mount type=bind,source=/shotshare/database.sqlite,target=/app/database/database.sqlite \
--mount type=bind,source=/shotshare/.env,target=/app/.env \
-d \
--restart unless-stopped \
--name shotshare \
mdshack/shotshare:latest