Deploying Slink
Introduction
Slink is a minimalist, self-hosted image sharing platform designed for simplicity and privacy. In an era of complex social media platforms, Slink strips image sharing down to its essentials: upload an image, get a link, share it. No accounts required, no tracking, no ads—just straightforward image hosting.
Built with a focus on speed and simplicity, Slink is perfect for developers, teams, or anyone who needs a reliable way to share images without the overhead of full-featured gallery applications.
Key features of Slink include:
- Simple Upload: Drag-and-drop or paste images to upload instantly
- Clean URLs: Short, shareable links for every image
- No Account Required: Anonymous uploads without registration
- API Support: Programmatic uploads for automation and integration
- Lightweight: Minimal resource requirements
- Self-Hosted: Complete control over your images and data
- Direct Links: Direct image URLs for embedding
- Multiple Formats: Support for common image formats
- Responsive Design: Works on desktop and mobile
- Open Source: Transparent and customizable
This guide walks through deploying Slink on Klutch.sh using Docker.
Why Deploy Slink on Klutch.sh
Deploying Slink on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles the build and deployment automatically.
Data Ownership: Your images stay on your infrastructure.
HTTPS by Default: Secure image sharing with automatic SSL.
Persistent Storage: Images survive restarts and redeployments.
Custom Domains: Use your own domain for branded image links.
Scalable Resources: Handle varying upload and traffic volumes.
Always Available: 24/7 access to your shared images.
Prerequisites
Before deploying Slink on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker
- (Optional) A custom domain for your image hosting
Deploying Slink on Klutch.sh
Create a GitHub Repository
Create a new GitHub repository for your Slink deployment configuration.
Create Your Dockerfile
Create a Dockerfile:
FROM node:18-alpine
WORKDIR /app
RUN apk add --no-cache git
RUN git clone https://github.com/anderspitman/slink.git .
RUN npm install
ENV PORT=8080ENV UPLOAD_DIR=/data/uploads
RUN mkdir -p /data/uploads
EXPOSE 8080
CMD ["npm", "start"]Alternatively, if using a different Slink implementation:
FROM golang:1.21-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
RUN git clone https://github.com/your-slink-repo/slink.git .
RUN go build -o slink .
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/slink .
RUN mkdir -p /data/uploads
ENV UPLOAD_DIR=/data/uploadsENV PORT=8080
EXPOSE 8080
CMD ["./slink"]Push Your Repository to GitHub
Commit and push your Dockerfile.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Create a new app and connect your GitHub repository.
Configure Environment Variables
Add any necessary environment variables:
| Variable | Value |
|---|---|
PORT | 8080 |
UPLOAD_DIR | /data/uploads |
MAX_FILE_SIZE | 10485760 (10MB, adjust as needed) |
Configure HTTP Settings
Set the traffic type to HTTP and configure the internal port to 8080.
Attach Persistent Storage
Add a persistent volume for image storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data/uploads | 10 GB+ | Uploaded images |
Deploy Your Application
Click Deploy to start the build process.
Access Slink
Once deployment completes, access your Slink instance at your app’s URL.
Start Sharing Images
Upload your first image and share the generated link.
Using Slink
Using Slink is straightforward:
- Upload: Drag and drop an image onto the page or use the upload button
- Get Link: Copy the generated URL
- Share: Send the link to anyone who needs to see the image
API Usage
Slink typically supports API uploads:
curl -X POST -F "file=@image.png" https://your-slink.klutch.sh/uploadThis returns a JSON response with the image URL.
Security Considerations
When running a public image host:
- Set appropriate file size limits
- Consider implementing rate limiting
- Monitor storage usage
- Consider adding authentication for upload functionality
Additional Resources
Conclusion
Deploying Slink on Klutch.sh gives you a simple, fast image sharing solution without the complexity of full-featured gallery applications. Whether you need quick screenshot sharing for a development team or a lightweight personal image host, Slink delivers the essentials without unnecessary overhead.
The combination of Klutch.sh’s deployment simplicity and Slink’s minimalist design means you can have a functional image sharing platform running in minutes.