Persistent Storage
Keep your data safe across deployments and restarts using persistent volumes.
By default, Docker containers are ephemeral—any data you save inside them is lost when the container stops. Slasha solves this by automatically attaching persistent storage volumes to your apps.
The Default Volume
Every app you create on Slasha gets a default persistent volume mounted at /data. We also inject a SLASHA_DATA_DIR environment variable that points to this directory.
Use this folder for anything that needs to persist, such as:
- SQLite databases (e.g.,
/data/db.sqlite) - User uploads and media files
- Persistent caches or logs
Persistence: Data in the /data volume survives app restarts, new deployments, and even server reboots. It is only deleted if you explicitly delete the app.
Custom Volumes
If you need to persist data in other locations, you can define custom volumes in your Dockerfile. Slasha will automatically detect these and provision the necessary storage.
# Example Dockerfile with custom volumes
FROM node:20
WORKDIR /app
# Define custom persistent paths
VOLUME /app/uploads
VOLUME /app/custom-config
CMD ["npm", "start"]
When you push your code, Slasha parses these VOLUME instructions and ensures they are mounted every time your app runs.
Railpack Note: If you are using the zero-config Railpack strategy (without a Dockerfile), only the default /data volume is available. To use custom volumes, you must switch to a Dockerfile.