Backend
Last updated
Was this helpful?
Last updated
Was this helpful?
This setup is meant for development. If you want a quick trial of Hyperswitch (without contributing), use .
Install .
Clone the repository and switch to the project directory:
(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.
Start all the services using Docker Compose:
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.
(Optional) You can also choose to in addition to the payments router.
Verify that the server is up and running by hitting the health endpoint:
If the command returned a 200 OK
status code, proceed with .
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.
Install the stable Rust toolchain using rustup
:
When prompted, proceed with the default
profile, which installs the stable toolchain.
Optionally, verify that the Rust compiler and cargo
are successfully installed:
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.
Install PostgreSQL and start the postgresql
systemd service:
Install Redis and start the redis
systemd service:
Install diesel_cli
using cargo
:
Make sure your system has the pkg-config
package and OpenSSL installed
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.
Install Ubuntu on WSL:
Install the stable Rust toolchain using rustup
:
When prompted, proceed with the default
profile, which installs the stable toolchain.
Optionally, verify that the Rust compiler and cargo
are successfully installed:
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.
Install PostgreSQL and start the postgresql
service:
Install Redis and start the redis-server
service:
Make sure your system has the packages necessary for compiling Rust code:
Install diesel_cli
using cargo
:
Make sure your system has the pkg-config
package and OpenSSL installed:
Install rust with winget
:
Install diesel_cli
using cargo
:
Install OpenSSL with winget
:
Install the stable Rust toolchain using rustup
:
Optionally, verify that the Rust compiler and cargo
are successfully installed:
Install PostgreSQL and start the postgresql
service:
If a postgres
database user was not already created, you may have to create one:
Install Redis and start the redis
service:
Install diesel_cli
using cargo
:
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
:
You may also choose to persist the value of PQ_LIB_DIR
in your shell startup file like so:
Install a command runner called just
:
In order to make running migrations easier, you can use a command runner called just
Create the database and database users, modifying the database user credentials and database name as required.
On Ubuntu-based systems (also applicable for Ubuntu on WSL2):
On MacOS:
Clone the repository and switch to the project directory:
Run database migrations:
Export the DATABASE_URL
env variable
Run the migrations
If you have just installed
Using the diesel-cli command
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 .
Setup using docker compose
Rust environment setup along with other dependencies