LogoLogo
Explore with DeepWikiJoin Slack CommunityContact Us
  • About Hyperswitch
    • Exploration Guide
    • Overview
    • Payments Suite
    • Payments Modules
      • Cost Observability
      • Revenue Recovery
      • Vault
        • Server to Server Vault tokenization
        • Vault SDK Integration
        • Hyperswitch Vault: Pass Through Proxy Payments
      • Intelligent Routing
      • Reconciliation
        • Getting Started with Recon
      • Alternate Payment Method Widgets
        • Hyperwidget Integration Guide
    • Roadmap - Q2 2025
      • Previous Roadmap - Q1 2025
      • Previous Roadmap - Q4 2024
      • Previous Roadmap - Q3 2024
      • Previous Roadmap - Q2 2024
      • Previous roadmap - Q1 2024
      • Previous roadmap - Q4 2023
  • Use-Cases
    • For SaaS Businesses
    • For B2B SaaS Businesses
    • For E-Commerce Businesses
    • For Marketplace/Platforms
  • Explore Hyperswitch
    • Payment Orchestration
      • Accept Payments
        • Connectors
          • Activate Connector on Hyperswitch
          • Try a Payment
          • Available Connectors
            • ACI
            • Adyen
            • Airwallex
            • Authorizedotnet
            • Bambora
            • Bank of America
            • Billwerk
            • Bluesnap
            • Braintree
            • Checkout
            • Coinbase
            • Cybersource
              • Apple Pay
              • Google Pay
            • dLocal
            • Fiserv
            • GlobalPayments
            • GoCardless
            • Klarna
            • Mollie
            • MultiSafepay
            • Nuvei
            • OpenNode
            • Paypal
            • PayU
            • Prophetpay
            • Rapyd
            • Shift4
            • Stripe
            • TrustPay
            • Volt
            • Worldline
            • Worldpay
            • Zen
            • Netcetera
              • Authenticating Payments via Netcetera Through HyperSwitch SDK
        • Setup Payment Methods
          • Cards
          • Wallets
            • Apple Pay
              • Web Domain
              • iOS Application
            • Google Pay
            • PayPal
          • Pay Later
          • Banks
            • Bank Debits
            • Bank Redirects
            • Bank Transfers
            • Open Banking
          • Crypto
          • Test Credentials
        • Payment Links
          • Configurations
          • Create Payment Links
          • Secure Payment Links
          • Setup Custom Domain
        • Save a Payment Method
        • Manual Capture
        • Incremental Authorization
        • Tokenization & Card Vault
          • Network Tokenisation
        • Supported Payment Workflows
        • Co-badged Cards
        • Webhooks
      • Process Payouts
        • Getting Started with Payouts
        • Using Saved Payment Methods
        • Smart Router for Payouts
        • Smart Retries in Payout
        • Payout Links
      • Smart Routing
        • Rule Based Routing
        • Volume Based Routing
        • Default Fallback Routing
      • Smart Retries
        • 3DS Step-up Retries
      • 3DS / Strong Customer Authentication
        • Setting up 3DS Decision Manager
        • Native 3DS Authentication
        • External Authentication for 3DS
      • Fraud & Risk Management
        • Activating FRM in Hyperswitch
        • Fraud Blocklist
      • Subscriptions
        • PG Agnostic Card Forwarding
        • Zero Amount Authorization
      • Split Payments
        • Stripe Split Payments
        • Adyen Split Payments
        • Xendit Split Payments
    • Checkout Experience
      • Customizable and Native Integrations
        • Web
          • Node And React
          • Customization
          • Error Codes
          • Node and HTML
          • Vanilla JS and REST API Integration
        • Android
          • Kotlin with Node Backend
          • Customization
          • Features
        • iOS
          • Swift with Node Backend
          • Customization
          • Features
        • React Native
          • React Native with Node Backend
          • Card Widget
          • Customization
        • Flutter
          • Flutter with Node Backend
          • Customization
        • Headless SDK
        • Server Setup
      • Click To Pay
        • Visa Click to Pay: V1 to V2 Migration
      • Payment Methods Management
    • Payment Operations
      • Managing Accounts and Profiles
        • ⚙️Control Centre Account setup
        • Hyperswitch Account Structure
      • Manage Your Team
      • Analytics & operations
        • Exporting payments data
      • Disputes / Chargebacks
      • Surcharge
        • Surcharge Setup guide
      • Multi-Tenancy
      • Data migration
        • Import data to Hyperswitch
        • Export data from Hyperswitch
    • Security and Compliance
      • PCI Compliance
      • Data Security
      • GDPR compliance
      • Identity and Access Management
    • E-commerce Platform Plugins by Hyperswitch
      • 🔌WooCommerce Plugin
        • Setup
        • Roadmap
        • Compatibility
        • FAQs
      • Saleor App
        • Setup
      • Automatic Tax calculation for Express Checkout wallets
  • Hyperswitch open source
    • Overview
      • Run Hyperswitch Locally Using Docker
        • Run Additional Services
      • Development Environment Setup
        • Backend
          • Configure and Run the Application
          • Try out APIs
        • SDK (Frontend)
        • Control Center
    • Deploy on AWS
      • Deploy on AWS using CloudFormation
      • Component-wise Deployment
        • Deploy app server
        • Deploy Control Center
        • Deploy web client
          • Production ready deployment
          • Integrate web client on your web app
          • Playground deployment for prototyping (optional)
        • Deploy Card Vault
          • Production ready deployment on AWS
          • Cloud setup guide
    • Deploy on Kubernetes
      • Deploy on GCP Using Helm Charts
      • Deploy on Azure Using Helm Charts
    • Account setup
      • Using Hyperswitch Control Center
      • Test a payment
      • Using postman
    • Troubleshooting
  • Testing Payments
  • Check list for Production
    • Going live
      • For SaaS Setup
      • For On-Prem Setup
        • Monitoring
        • PCI compliance
          • Get started
          • Completing the SAQ
        • Data Security
        • Updates
  • Learn more
    • API Reference
    • Connectors Supported
    • SDK Reference
      • React
      • JS
      • Custom Events
    • Hyperswitch architecture
      • Router
      • Storage
      • A Payments Switch with virtually zero overhead
    • Payment flows
    • Blog
  • Community Guidelines
Powered by GitBook

Compliance

  • Vulnerability Disclosure
  • PCI DSS 4.0
  • ISO 27001:2022

Community

  • Slack
  • Discord
  • GitHub Discussion
On this page
  • Supported Methods:
  • Set up a development environment using Docker Compose
  • Set up a Rust environment and other dependencies
  • Set up dependencies on Ubuntu-based systems
  • Set up dependencies on Windows (Ubuntu on WSL2)
  • Set up dependencies on Windows
  • Set up dependencies on MacOS
  • Set up the database

Was this helpful?

  1. Hyperswitch open source
  2. Overview
  3. Development Environment Setup

Backend

Last updated 1 month ago

Was this helpful?

This setup is meant for development. If you want a quick trial of Hyperswitch (without contributing), use .

Supported Methods:

Set up a development environment using Docker Compose

  1. Install .

  2. Clone the repository and switch to the project directory:

    git clone https://github.com/juspay/hyperswitch
    cd hyperswitch
  3. (Optional) Configure the application using the file. The provided configuration should work as is. If you do update the docker_compose.toml file, ensure to also update the corresponding values in the file.

  4. Start all the services using Docker Compose:

    docker compose --file docker-compose-development.yml up -d

    This will compile the payments router, the primary component within hyperswitch and then start it. Depending on the specifications of your machine, compilation can take around 15 minutes.

  5. (Optional) You can also choose to in addition to the payments router.

  6. Verify that the server is up and running by hitting the health endpoint:

    curl --head --request GET 'http://localhost:8080/health'

    If the command returned a 200 OK status code, proceed with .

Set up a Rust environment and other dependencies

Set up dependencies on Ubuntu-based systems

This section of the guide provides instructions to install dependencies on Ubuntu-based systems. If you're running another Linux distribution, install the corresponding packages for your distribution and follow along.

  1. Install the stable Rust toolchain using rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    When prompted, proceed with the default profile, which installs the stable toolchain.

    Optionally, verify that the Rust compiler and cargo are successfully installed:

    rustc --version

    Be careful when running shell scripts downloaded from the Internet. We only suggest running this script as there seems to be no rustup package available in the Ubuntu package repository.

  2. Install PostgreSQL and start the postgresql systemd service:

    sudo apt update
    sudo apt install postgresql postgresql-contrib libpq-dev
    systemctl start postgresql.service
  3. Install Redis and start the redis systemd service:

    sudo apt install redis-server
    systemctl start redis.service
  4. Install diesel_cli using cargo:

    cargo install diesel_cli --no-default-features --features postgres
  5. Make sure your system has the pkg-config package and OpenSSL installed

    sudo apt install pkg-config libssl-dev

Set up dependencies on Windows (Ubuntu on WSL2)

This section of the guide provides instructions to install dependencies on Ubuntu on WSL2. If you prefer running another Linux distribution, install the corresponding packages for your distribution and follow along.

  1. Install Ubuntu on WSL:

    wsl --install -d Ubuntu
  2. Install the stable Rust toolchain using rustup:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    When prompted, proceed with the default profile, which installs the stable toolchain.

    Optionally, verify that the Rust compiler and cargo are successfully installed:

    rustc --version

    Be careful when running shell scripts downloaded from the Internet. We only suggest running this script as there seems to be no rustup package available in the Ubuntu package repository.

  3. Install PostgreSQL and start the postgresql service:

    sudo apt update
    sudo apt install postgresql postgresql-contrib libpq-dev
    sudo service postgresql start
  4. Install Redis and start the redis-server service:

    sudo apt install redis-server
    sudo service redis-server start
  5. Make sure your system has the packages necessary for compiling Rust code:

    sudo apt install build-essential
  6. Install diesel_cli using cargo:

    cargo install diesel_cli --no-default-features --features postgres
  7. Make sure your system has the pkg-config package and OpenSSL installed:

    sudo apt install pkg-config libssl-dev

Set up dependencies on Windows

  1. Install rust with winget:

    winget install -e --id Rustlang.Rust.GNU
  2. Install diesel_cli using cargo:

    cargo install diesel_cli --no-default-features --features postgres
  3. Install OpenSSL with winget:

    winget install openssl

Set up dependencies on MacOS

  1. Install the stable Rust toolchain using rustup:

    brew install rustup
    rustup default stable

    Optionally, verify that the Rust compiler and cargo are successfully installed:

    rustc --version
  2. Install PostgreSQL and start the postgresql service:

    brew install postgresql@14
    brew services start postgresql@14

    If a postgres database user was not already created, you may have to create one:

    createuser -s postgres
  3. Install Redis and start the redis service:

    brew install redis
    brew services start redis
  4. Install diesel_cli using cargo:

    cargo install diesel_cli --no-default-features --features postgres

    If linking diesel_cli fails due to missing libpq (if the error message is along the lines of cannot find -lpq), you may also have to install libpq and reinstall diesel_cli:

    brew install libpq
    export PQ_LIB_DIR="$(brew --prefix libpq)/lib"
    
    cargo install diesel_cli --no-default-features --features postgres

    You may also choose to persist the value of PQ_LIB_DIR in your shell startup file like so:

    echo 'PQ_LIB_DIR="$(brew --prefix libpq)/lib"' >> ~/.zshrc
  5. Install a command runner called just:

    In order to make running migrations easier, you can use a command runner called just

    cargo install just

Set up the database

  1. Create the database and database users, modifying the database user credentials and database name as required.

    export DB_USER="db_user"
    export DB_PASS="db_pass"
    export DB_NAME="hyperswitch_db"

    On Ubuntu-based systems (also applicable for Ubuntu on WSL2):

    sudo -u postgres psql -e -c \
       "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
    sudo -u postgres psql -e -c \
       "CREATE DATABASE $DB_NAME;"

    On MacOS:

    psql -e -U postgres -c \
       "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"
    psql -e -U postgres -c \
       "CREATE DATABASE $DB_NAME"
  2. Clone the repository and switch to the project directory:

    git clone https://github.com/juspay/hyperswitch
    cd hyperswitch
  3. Run database migrations:

    Export the DATABASE_URL env variable

    export DATABASE_URL=postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME

    Run the migrations

    • If you have just installed

    just migrate
    • Using the diesel-cli command

    diesel migration run

Once you're done with setting up the database, proceed with configuring the application.

If you are using nix, please skip the setup dependencies step and jump to .

If you're running any other distribution than Ubuntu, you can follow the installation instructions on the to set up PostgreSQL on your system.

If you're running a distribution other than Ubuntu, you can follow the installation instructions on the to set up Redis on your system.

Once you're done with setting up the dependencies, proceed with .

Refer to the for more information. Launch the WSL instance and set up your username and password. The following steps assume that you are running the commands within the WSL shell environment.

Note that a SIGKILL error may occur when compiling certain crates if WSL is unable to use sufficient memory. It may be necessary to allow up to 24GB of memory, but your mileage may vary. You may increase the amount of memory WSL can use via a .wslconfig file in your Windows user folder, or by creating a swap file in WSL itself. Refer to the for more information.

For more information, refer to the docs for . If you're running any other distribution than Ubuntu, you can follow the installation instructions on the to set up PostgreSQL on your system.

For more information, refer to the docs for . If you're running a distribution other than Ubuntu, you can follow the installation instructions on the to set up Redis on your system.

Once you're done with setting up the dependencies, proceed with .

We'll be using in this section of the guide, where possible. You can opt to use your favorite package manager instead.

Install PostgreSQL database, following the .

Install Redis, following the .

Once you're done with setting up the dependencies, proceed with .

We'll be using in this section of the guide. You can opt to use your favorite package manager instead.

Once you're done with setting up the dependencies, proceed with .

PostgreSQL documentation website
Redis website
official installation docs
WSL configuration documentation
installing PostgreSQL on WSL
PostgreSQL documentation website
installing Redis on WSL
Redis website
winget
official installation docs
official installation docs
Homebrew
Configure and Run the Application

Setup using docker compose

Rust environment setup along with other dependencies

this guide
Docker Compose
config/docker_compose.toml
docker-compose.yml
start the scheduler and/or monitoring services
trying out our APIs
Set up the database
setting up the database
setting up the database
setting up the database
setting up the database