PicoShare
Stack
Minimalist file sharing: upload any file and get a direct link to it, with no re-encoding, no size limit and an optional expiry date. Guest links let other people upload files to you. Source: https://github.com/mtlynch/picoshare
Image details
Source details
Configuration
TypeComposelinuxmtlynch/picoshare:latest${PICOSHARE_PORT:-4001}:4001/data : picoshare-dataPORT=4001PS_SHARED_SECRET=${PICOSHARE_PASSWORD:?Set a password}PICOSHARE_PASSWORD=''PICOSHARE_PORT=4001unless-stoppedTemplate by NotAFlightRisk·Source
Report issueNotes
http://<your-host>:4001 (or whichever port you picked), click Log In and enter it. Changing it on the form and redeploying swaps it for the new one. Share links are built from the address you're on, and anyone with a link can download the file without logging in. Uploads expire after 30 days unless you pick otherwise, and you can change that default under System --> Settings. Guest Links make an upload page for someone else, with optional limits on size and number of files. Everything, files included, lives in a SQLite database in the picoshare-data volume. Docs: github.com/mtlynch/picoshareStandalone Install
Select an install method, to see config/commands for deploying PicoShare
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select PicoShare, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
services:
picoshare:
image: mtlynch/picoshare:latest
restart: unless-stopped
ports:
- "${PICOSHARE_PORT:-4001}:4001"
environment:
PORT: "4001"
PS_SHARED_SECRET: ${PICOSHARE_PASSWORD:?Set a password}
volumes:
- picoshare-data:/data
volumes:
picoshare-data:
Or deploy it directly from the source:
git clone https://github.com/NotAFlightRisk/portainer-templates-extras
cd portainer-templates-extras
docker compose -f apps/picoshare/compose.yml up -dMore install options in our documentation, or see mtlynch/picoshare for app-specific guidance.
PicoShare
Overview
PicoShare is a minimalist service that allows you to share files easily.
Why PicoShare?
There are a million services for sharing files, but none of them are quite like PicoShare. Here are PicoShare's advantages:- Direct download links: PicoShare gives you a direct download link you can share with anyone. They can view or download the file with no ads or signups.
- No file restrictions: Unlike sites like imgur, Vimeo, or SoundCloud that only allow you to share specific types of files, PicoShare lets you share any file of any size.
- No resizing/re-encoding: If you upload media like images, video, or audio, PicoShare never forces you to wait on re-encoding. You get a direct download link as soon as you upload the file, and PicoShare never resizes or re-encodes your file.
Run PicoShare
From source
PS_SHARED_SECRET=somesecretpass PORT=3001 \
go run main.goFrom Docker
To run PicoShare within a Docker container, mount a volume from your local system to store the PicoShare sqlite database.docker run \
--env "PORT=3001" \
--env "PS_SHARED_SECRET=somesecretpass" \
--publish 3001:3001/tcp \
--volume "${PWD}/data:/data" \
--name picoshare \
mtlynch/picoshareFrom Docker + cloud data replication
If you specify settings for a Litestream-compatible cloud storage location, PicoShare will automatically replicate your data.You can kill the container and start it later, and PicoShare will restore your data from the cloud storage location and continue as if there was no interruption.
PORT=3001
PS_SHARED_SECRET="somesecretpass"
LITESTREAM_BUCKET=YOUR-LITESTREAM-BUCKET
LITESTREAM_ENDPOINT=YOUR-LITESTREAM-ENDPOINT
LITESTREAM_ACCESS_KEY_ID=YOUR-ACCESS-ID
LITESTREAM_SECRET_ACCESS_KEY=YOUR-SECRET-ACCESS-KEY
docker run \
--env "PORT=${PORT}" \
--env "PS_SHARED_SECRET=${PS_SHARED_SECRET}" \
--env "LITESTREAM_ACCESS_KEY_ID=${LITESTREAM_ACCESS_KEY_ID}" \
--env "LITESTREAM_SECRET_ACCESS_KEY=${LITESTREAM_SECRET_ACCESS_KEY}" \
--env "LITESTREAM_BUCKET=${LITESTREAM_BUCKET}" \
--env "LITESTREAM_ENDPOINT=${LITESTREAM_BUCKET}" \
--publish 3001:3001/tcp \
--name picoshare \
mtlynch/picoshareNotes:
- Only run one Docker container for each Litestream location.
Parameters
Command-line flags
| Flag | Meaning | Default Value |
|---|---|---|
-db | Path to SQLite database | "data/store.db" |
Docker environment variables
You can adjust behavior of the Docker container by passing these parameters withdocker run -e:| Environment Variable | Meaning |
|---|---|
PORT | TCP port on which to listen for HTTP connections (defaults to 3001). |
LITESTREAMBUCKET | Litestream-compatible cloud storage bucket where Litestream should replicate data. |
LITESTREAMENDPOINT | Litestream-compatible cloud storage endpoint where Litestream should replicate data. |
LITESTREAMACCESSKEYID | Litestream-compatible cloud storage access key ID to the bucket where you want to replicate data. |
LITESTREAMSECRETACCESSKEY | Litestream-compatible cloud storage secret access key to the bucket where you want to replicate data. |
Docker build args
If you rebuild the Docker image from source, you can adjust the build behavior withdocker build --build-arg:| Build Arg | Meaning | Default Value |
|---|---|---|
litestreamversion | Version of Litestream to use for data replication | 0.3.8 |
Deployment
PicoShare is easy to deploy to cloud hosting platforms:Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Image won't pull
Test the pull directly on the host: docker pull mtlynch/picoshare:latest
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- This image supports:
amd64, arm64, arm/v7 - Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Required settings are blank
PICOSHARE_PASSWORD has no default value, and picoshare may crash or misbehave if left empty.
- Fill it in on the deploy screen before hitting deploy.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue on mtlynch/picoshare
- Template not working: Open an issue on NotAFlightRisk/portainer-templates-extras
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
PicoShare is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.
The app image
An image is the app packed up ready to go, everything PicoShare needs bundled into one download. This template pulls mtlynch/picoshare:latest, which Docker fetches once (about 17 MB) and then starts your own copy from.
Where the image comes from
Docker pulls its images from registries, public libraries of ready-built apps. PicoShare's comes from Docker Hub, published by mtlynch.
Version tags
The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Newest right now is v1.5.4. Pin a specific tag if you would rather stay on one version.
Which machines it runs on
Every image is built for particular CPU types. This one ships for amd64, arm64, arm/v7, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.
Volumes
A volume is where PicoShare keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/datakept in thepicoshare-datavolume Docker manages
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. PicoShare takes 4 of them, and 2 need a value before it'll start properly:
PORT, defaults to4001PS_SHARED_SECRET, needs a valuePICOSHARE_PASSWORD, needs a value. What you'll log in with. Anything long and hard to guess, or generate one with: openssl rand -hex 16PICOSHARE_PORT, defaults to4001. Host port for the web UI
Restart policy
The restart policy here is unless-stopped, so Docker restarts PicoShare after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Nothing custom is set, so PicoShare sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.
Container name
Once it's deployed, Portainer names the container picoshare. That's what you'll spot in the containers list and use in commands like docker logs picoshare.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set PicoShare up. Add the template list to Portainer once, then deploying PicoShare is a click rather than a wall of config.