Skip to content

Deploying Tryton

Introduction

Tryton is a modular, open-source ERP (Enterprise Resource Planning) platform designed to manage all aspects of business operations. Built with Python and following a three-tier architecture, Tryton provides a solid foundation for accounting, inventory management, sales, purchases, and much more.

Unlike monolithic ERP solutions, Tryton’s modular design lets you install only the components you need. Starting from a core framework, you can add modules for accounting, stock management, CRM, manufacturing, and dozens of other business functions as your needs grow.

Key highlights of Tryton:

  • Modular Architecture: Install only the modules you need, from simple accounting to full ERP
  • Multi-Company Support: Manage multiple companies with a single installation
  • Double-Entry Accounting: Complete accounting with chart of accounts, journals, and fiscal years
  • Inventory Management: Track stock movements, locations, and warehouse operations
  • Sales and Purchases: Full order-to-invoice workflow for customers and suppliers
  • Manufacturing: Production planning and bill of materials management
  • CRM: Customer relationship management with opportunities and activities
  • Point of Sale: POS integration for retail operations
  • Web and Desktop Clients: Access via browser or native desktop application
  • Open Source: Licensed under GPL v3 with no vendor lock-in

This guide walks through deploying Tryton on Klutch.sh using Docker, setting up the database, and configuring modules for your business needs.

Why Deploy Tryton on Klutch.sh

Deploying Tryton on Klutch.sh provides several advantages for business management:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Tryton without complex server configuration. Push to GitHub, and your ERP system deploys automatically.

Persistent Storage: Attach persistent volumes for your database and document storage. Your business data survives container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your business data from anywhere.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on your business size and user count. Start small and scale as your business grows.

Always-On Availability: Your business operations system remains accessible 24/7 from any location.

Prerequisites

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

  • A Klutch.sh account
  • A GitHub account with a repository for your Tryton configuration
  • Basic familiarity with Docker and ERP concepts
  • A PostgreSQL database (can be deployed separately on Klutch.sh)
  • (Optional) A custom domain for your Tryton instance

Understanding Tryton Architecture

Tryton follows a three-tier architecture:

Tryton Server (trytond): The application server that handles business logic, data access, and client connections.

PostgreSQL Database: Stores all business data including transactions, inventory, and configuration.

Client Applications: Web client (Sao) for browser access or desktop client (Tryton) for native application experience.

Module System: Modular extensions that add specific business functionality like accounting, inventory, or CRM.

Preparing Your Repository

To deploy Tryton on Klutch.sh, create a GitHub repository containing your Dockerfile and configuration.

Repository Structure

tryton-deploy/
├── Dockerfile
├── trytond.conf
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM tryton/tryton:latest
# Install additional modules as needed
RUN pip install --no-cache-dir \
trytond-account \
trytond-stock \
trytond-sale \
trytond-purchase \
trytond-party \
trytond-company \
trytond-product
# Copy configuration
COPY trytond.conf /etc/trytond.conf
# Create necessary directories
RUN mkdir -p /var/lib/trytond
# Expose the web interface port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8000/ || exit 1

Configuration File

Create trytond.conf for your Tryton server configuration:

[web]
listen = 0.0.0.0:8000
root = /usr/share/sao
[database]
uri = postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/
path = /var/lib/trytond
[session]
timeout = 600
[cache]
class = trytond.cache.MemoryCache

Environment Variables Reference

VariableRequiredDefaultDescription
DB_HOSTYes-PostgreSQL server hostname
DB_PORTNo5432PostgreSQL server port
DB_USERYes-PostgreSQL username
DB_PASSWORDYes-PostgreSQL password
ADMIN_PASSWORDNo-Password for admin database operations

Deploying Tryton on Klutch.sh

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

    Set Up a PostgreSQL Database

    Tryton requires a PostgreSQL database. Deploy one on Klutch.sh or use a managed PostgreSQL service. Note the connection details for the next steps.

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile trytond.conf .dockerignore
    git commit -m "Initial Tryton deployment configuration"
    git remote add origin https://github.com/yourusername/tryton-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 “tryton” or “erp”.

    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 Tryton Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 8000 (Tryton web interface port)

    Set Environment Variables

    In the environment variables section, add the following:

    VariableValue
    DB_HOSTYour PostgreSQL host
    DB_PORT5432
    DB_USERYour database username
    DB_PASSWORDYour database password

    Attach Persistent Volumes

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

    Mount PathRecommended SizePurpose
    /var/lib/trytond5 GBDatabase files, attachments, and session data

    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 Tryton container
    • Provision an HTTPS certificate

    Create Your Database

    After deployment, you’ll need to initialize your Tryton database. Access the admin interface or use the Tryton desktop client to create a new database with your desired modules.

    Access Tryton

    Once the database is created, access your Tryton instance at https://your-app-name.klutch.sh. Log in with the admin credentials you created.

Initial Setup and Configuration

Creating a Database

When first accessing Tryton:

  1. Use the admin interface or desktop client
  2. Click “Create Database”
  3. Enter database name, admin password, and language
  4. Select modules to install (start with core modules)
  5. Wait for initialization to complete

Essential Modules

Start with these core modules for basic business operations:

  • company: Multi-company support
  • party: Customer and supplier management
  • product: Product catalog
  • account: General accounting
  • stock: Inventory management
  • sale: Sales orders
  • purchase: Purchase orders

Company Setup

Configure your company after installation:

  1. Go to Administration > Companies
  2. Create your company with legal name and details
  3. Configure currency and fiscal settings
  4. Set up chart of accounts

Users and Access

Create user accounts for your team:

  1. Navigate to Administration > Users
  2. Create user accounts
  3. Assign appropriate access groups
  4. Set company assignments for multi-company setups

Accounting Configuration

Chart of Accounts

Set up your accounting structure:

  1. Go to Accounting > Configuration > Charts
  2. Create or import a chart of accounts
  3. Configure account types and hierarchy
  4. Set up default accounts for operations

Fiscal Year

Configure your fiscal periods:

  1. Navigate to Accounting > Configuration > Fiscal Years
  2. Create fiscal year with start and end dates
  3. Generate periods (monthly, quarterly)
  4. Set sequences for invoices and journals

Journals

Set up accounting journals:

  • Sales Journal
  • Purchase Journal
  • Cash Journal
  • Bank Journals
  • General Journal

Inventory Management

Locations

Configure warehouse locations:

  1. Go to Inventory > Configuration > Locations
  2. Create warehouse structure
  3. Set up storage locations, input/output zones
  4. Configure location types (internal, customer, supplier)

Products

Set up your product catalog:

  1. Navigate to Product > Products
  2. Create product templates
  3. Configure variants if needed
  4. Set stock and accounting settings

Inventory Operations

Track stock movements:

  • Shipments for customer deliveries
  • Supplier receipts for incoming goods
  • Internal moves between locations
  • Inventory adjustments

Sales and Purchasing

Sales Workflow

Process customer orders:

  1. Create quotation
  2. Convert to sales order
  3. Confirm order
  4. Process shipment
  5. Generate invoice

Purchase Workflow

Manage supplier orders:

  1. Create purchase request
  2. Convert to purchase order
  3. Receive shipment
  4. Process supplier invoice
  5. Record payment

Production Best Practices

Security Recommendations

  • Strong Passwords: Use secure passwords for all users
  • Role-Based Access: Limit user permissions appropriately
  • Audit Trail: Enable logging for compliance
  • Regular Backups: Back up database regularly

Backup Strategy

Protect your business data:

  1. Database Backups: Regular PostgreSQL backups
  2. Attachment Storage: Back up /var/lib/trytond
  3. Configuration: Version control your configuration files
  4. Test Restores: Regularly verify backup integrity

Performance Optimization

  • Database Tuning: Configure PostgreSQL for your workload
  • Caching: Enable appropriate caching
  • Module Selection: Install only needed modules
  • Resource Scaling: Adjust resources based on user count

Troubleshooting Common Issues

Database Connection Errors

Symptoms: Cannot connect to database or application errors.

Solutions:

  • Verify PostgreSQL credentials
  • Check database server connectivity
  • Review connection string in configuration

Module Installation Issues

Symptoms: Modules not appearing or errors during installation.

Solutions:

  • Verify module dependencies are installed
  • Check Python package installation
  • Review installation logs for errors

Performance Problems

Symptoms: Slow response times or timeouts.

Solutions:

  • Optimize database queries
  • Check database indexes
  • Increase server resources
  • Review module configuration

Additional Resources

Conclusion

Deploying Tryton on Klutch.sh gives you a powerful, modular ERP system for managing your business operations. The combination of Tryton’s comprehensive business functionality and Klutch.sh’s deployment simplicity means you can focus on running your business rather than managing infrastructure.

With support for accounting, inventory, sales, purchasing, and manufacturing, Tryton scales from small businesses to large enterprises. Its modular architecture ensures you only run the components you need, while the ability to add modules over time means your ERP grows with your business.