Skip to content

Deploying Litecart

Introduction

Litecart is a revolutionary single-file shopping cart solution that brings simplicity back to e-commerce. Unlike bloated e-commerce platforms that require complex infrastructure, Litecart packages everything you need into a single executable with an embedded SQLite database. This minimalist approach means you can have a fully functional online store running in under 5 minutes with minimal server resources.

Built with Go for performance and efficiency, Litecart delivers sub-second page loads while requiring only 64MB of RAM. The application includes a convenient dashboard UI for managing products, orders, and settings, along with a customizable storefront that can be tailored to match your brand.

Key highlights of Litecart:

  • Single File Deployment: The entire application runs from one executable with no external dependencies
  • Embedded SQLite Database: No need for separate database servers or complex configurations
  • Payment Gateway Support: Built-in integration with Stripe, PayPal, and cryptocurrency payments
  • Lightweight Requirements: Runs smoothly on 64MB RAM with sub-second page loads
  • HTTPS by Default: Automatic SSL certificate provisioning for secure transactions
  • Digital Products: Support for selling both physical and digital goods
  • Customizable Themes: Modify the look and feel of your storefront
  • Multi-Currency Support: Accept payments in various currencies
  • Order Management: Complete dashboard for managing orders, inventory, and customers
  • Open Source: Licensed under Apache 2.0 with active community development

This guide walks through deploying Litecart on Klutch.sh using Docker, configuring payment gateways, and setting up your online store for production use.

Why Deploy Litecart on Klutch.sh

Deploying Litecart on Klutch.sh provides several advantages for your e-commerce operations:

Effortless Setup: Klutch.sh automatically builds and deploys your Litecart container from a Dockerfile. No complex orchestration or manual server configuration required.

Persistent Storage: Attach persistent volumes for your SQLite database, uploaded product images, and digital downloads. Your store data survives container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, essential for secure e-commerce transactions and customer trust.

GitHub Integration: Connect your configuration repository directly from GitHub. Push updates to trigger automatic redeployments.

Cost-Effective: Litecart’s minimal resource requirements mean you can run a full e-commerce store on budget-friendly server plans.

Scalable Resources: Start small and scale up as your store grows. Allocate more CPU and memory during peak shopping seasons.

Environment Variable Security: Store sensitive payment gateway credentials securely through Klutch.sh’s environment variable system.

Custom Domains: Use your own domain name for a professional storefront that builds customer confidence.

Prerequisites

Before deploying Litecart on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Litecart configuration
  • Basic familiarity with Docker and containerization concepts
  • (Optional) Payment gateway accounts (Stripe, PayPal) for processing transactions
  • (Optional) A custom domain for your store

Understanding Litecart Architecture

Litecart follows a streamlined architecture optimized for simplicity and performance:

Go Backend: The application is written in Go, providing excellent performance and cross-platform compatibility. The single binary contains all server logic, routing, and business logic.

Embedded SQLite: All data including products, orders, customers, and settings are stored in a local SQLite database file. This eliminates the need for external database services while maintaining ACID compliance.

Static File Serving: Litecart serves its own frontend assets, product images, and digital downloads without requiring a separate web server.

Modular Configuration: Store settings, payment configurations, and theme customizations are managed through the admin dashboard and stored in the database.

Preparing Your Repository

To deploy Litecart on Klutch.sh, create a GitHub repository containing your Dockerfile.

Repository Structure

litecart-deploy/
├── Dockerfile
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM shurco/litecart:latest
# Set environment variables for configuration
ENV LC_BIND=0.0.0.0:8080
# Create directories for persistent data
RUN mkdir -p /data/db /data/uploads /data/digitals /data/site
# Expose the web interface port
EXPOSE 8080
# The base image includes the default entrypoint

Creating the .dockerignore File

Create a .dockerignore file to exclude unnecessary files:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

Litecart supports configuration through environment variables:

VariableRequiredDefaultDescription
LC_BINDNo0.0.0.0:8080Address and port to bind the server
LC_DB_PATHNo/data/db/litecart.dbPath to the SQLite database file
LC_UPLOADS_PATHNo/data/uploadsDirectory for product image uploads
LC_DIGITALS_PATHNo/data/digitalsDirectory for digital product files

Deploying Litecart on Klutch.sh

Once your repository is prepared, follow these steps to deploy Litecart:

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile .dockerignore
    git commit -m "Initial Litecart deployment configuration"
    git remote add origin https://github.com/yourusername/litecart-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “litecart” or “my-online-store”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Litecart Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 8080

    Set Environment Variables

    In the environment variables section, configure any custom settings:

    VariableValue
    LC_BIND0.0.0.0:8080

    Attach Persistent Volumes

    Persistent storage is essential for Litecart. Add the following volumes:

    Mount PathRecommended SizePurpose
    /data/db1 GBSQLite database storing products, orders, and settings
    /data/uploads10 GBProduct images and media files
    /data/digitals50 GBDigital product files for download
    /data/site1 GBSite customizations and theme files

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Litecart container
    • Provision an HTTPS certificate

    Access Litecart

    Once deployment completes, access your store at https://your-app-name.klutch.sh. The setup wizard will guide you through initial configuration.

Initial Setup and Configuration

First-Time Setup

When you first access your Litecart instance:

  1. Create Admin Account: Set up your administrator username and password
  2. Store Settings: Configure your store name, currency, and contact information
  3. Payment Setup: Connect your payment gateways
  4. Add Products: Start adding your product catalog

Payment Gateway Configuration

Stripe Setup

  1. Navigate to SettingsPayments
  2. Enable Stripe and enter your API keys
  3. Configure webhook endpoints for order notifications
  4. Test with Stripe’s test mode before going live

PayPal Setup

  1. Navigate to SettingsPayments
  2. Enable PayPal and enter your client credentials
  3. Configure IPN (Instant Payment Notification) URLs
  4. Verify sandbox testing before production

Cryptocurrency Payments

Litecart supports cryptocurrency payments through various providers:

  1. Enable cryptocurrency in payment settings
  2. Configure your wallet addresses
  3. Set conversion rates or enable automatic pricing

Adding Products

Create your product catalog:

  1. Navigate to Products in the dashboard
  2. Click Add Product
  3. Enter product details:
    • Name and description
    • Price and inventory
    • Images (upload or URL)
    • Categories and tags
  4. For digital products, upload the downloadable files
  5. Set visibility and publish

Customizing Your Store

Theme Customization

Litecart allows storefront customization:

  1. Access SettingsAppearance
  2. Modify colors, fonts, and layout
  3. Upload your logo and favicon
  4. Preview changes before publishing

Custom Pages

Create additional pages for your store:

  • About Us
  • Contact
  • Shipping Information
  • Return Policy
  • Terms of Service

Production Best Practices

Security Recommendations

  • Strong Admin Password: Use a complex, unique password for your admin account
  • Regular Backups: Implement automated backups of your database and uploads
  • Monitor Orders: Review orders regularly for fraudulent activity
  • Keep Updated: Pull the latest Litecart image regularly for security patches

Performance Optimization

  • Image Optimization: Compress product images before uploading
  • CDN Integration: Consider using a CDN for static assets
  • Database Maintenance: The SQLite database is self-maintaining but benefits from periodic optimization

Backup Strategy

Protect your store data:

  1. Database Backups: Regularly back up /data/db/litecart.db
  2. Media Backups: Back up /data/uploads containing product images
  3. Digital Products: Maintain copies of /data/digitals files
  4. Configuration Export: Export settings through the admin dashboard

Troubleshooting Common Issues

Store Not Loading

Symptoms: Browser cannot connect to store.

Solutions:

  • Verify deployment is running in Klutch.sh dashboard
  • Confirm HTTP traffic type with port 8080
  • Check deployment logs for errors

Payment Processing Failures

Symptoms: Customers cannot complete checkout.

Solutions:

  • Verify payment gateway API keys
  • Check webhook configurations
  • Review payment gateway dashboards for errors
  • Ensure HTTPS is properly configured

Image Upload Issues

Symptoms: Product images fail to upload.

Solutions:

  • Check available storage on the uploads volume
  • Verify file size limits
  • Ensure proper permissions on mount paths

Database Errors

Symptoms: Store shows errors or data inconsistencies.

Solutions:

  • Check database file permissions
  • Verify sufficient storage space
  • Review application logs for specific errors

Additional Resources

Conclusion

Deploying Litecart on Klutch.sh gives you a lightweight, efficient e-commerce platform with minimal overhead. The combination of Litecart’s single-file simplicity and Klutch.sh’s deployment automation means you can launch an online store quickly without managing complex infrastructure.

With support for major payment gateways, digital products, and customizable storefronts, Litecart scales from small hobby shops to serious online businesses. The minimal resource requirements make it cost-effective to run, while the modern architecture ensures fast page loads that keep customers engaged.

Whether you’re selling handmade crafts, digital downloads, or physical products, Litecart on Klutch.sh provides a reliable foundation for your e-commerce journey.