Skip to content

Small-scale manual deployment#

This guide describes the installation of a small-scale installation of i-ticket from source. By small-scale, we mean that everything is being run on one host and you don't expect thousands of participants trying to get a ticket within a few minutes. In this setup, you will have to perform a number of manual steps. If you prefer using a container solution with many things readily set-up, look at Small-scale deployment with docker.

Warning

Even though we try to make it straightforward to run i-ticket, it still requires some Linux experience to get it right. If you're not feeling comfortable managing a Linux server, check out our hosting and service offers at i-ticket.app/control.

We tested this guide on the Linux distribution Debian 12 but it should work very similar on other modern distributions, especially on all systemd-based ones.

Requirements#

Please set up the following systems beforehand, we'll not explain them here in detail (but see these links for external installation guides):

  • A python 3.11+ installation
  • A SMTP server to send out mails, e.g. Postfix on your machine or some third-party server you have credentials for
  • A HTTP reverse proxy, e.g. nginx or Apache to allow HTTPS connections
  • A PostgreSQL 14+ database server
  • A redis server
  • A nodejs installation

We also recommend that you use a firewall, although this is not a i-ticket-specific recommendation. If you're new to Linux and firewalls, we recommend that you start with ufw.

Note

Please, do not run i-ticket without HTTPS encryption. You'll handle user data and thanks to Let's Encrypt SSL certificates can be obtained for free these days. We also do not provide support for HTTP-only installations except for evaluation purposes.

Unix user#

As we do not want to run i-ticket as root, we first create a new unprivileged user:

In this guide, all code lines prepended with a symbol are commands that you need to execute on your server as user (e.g. using ); all lines prepended with a symbol should be run by the unprivileged user.

Database#

Having the database server installed, we still need a database and a database user. We can create these with any kind of database managing tool or directly on our database's shell. Please make sure that UTF8 is used as encoding for the best compatibility. You can check this with the following command:

For PostgreSQL database creation, we would do:

Package dependencies#

To build and run pretix, you will need the following debian packages:

Config file#

We now create a config directory and config file for i-ticket:

Fill the configuration file with the following content (adjusted to your environment):

See Email settings to learn more about configuring mail features.

Install pretix from PyPI#

Now we will install pretix itself. The following steps are to be executed as the user. Before we actually install i-ticket, we will create a virtual environment to isolate the python packages from your global python installation:

We now install pretix, its direct dependencies and gunicorn:

Note that you need Python 3.11 or newer. You can find out your Python version using .

We also need to create a data directory and allow your webserver to traverse to the root directory:

Finally, we compile static files and translation data and create the database structure:

Start pretix as a service#

We recommend starting pretix using systemd to make sure it runs correctly after a reboot. Create a file named with the following content:

For background tasks we need a second service with the following content:

You can now run the following commands to enable and start the services:

Cronjob#

You need to set up a cronjob that runs the management command . The exact interval is not important but should be something between every minute and every hour. You could for example configure cron like this:

The cronjob should run as the user ().

SSL#

The following snippet is an example on how to configure a nginx proxy for i-ticket:

Note

Remember to replace the in the path in the config above with your python version.

We recommend reading about setting strong encryption settings for your web server.

Next steps#

Yay, you are done! You should now be able to reach pretix at https://pretix.yourdomain.com/control/ and log in as admin@localhost with a password of admin. Don't forget to change that password! Create an organizer first, then create an event and start selling tickets!

You should probably read Backups and monitoring next.

Updates#

Warning

While we try hard not to break things, please perform a backup before every upgrade.

To upgrade to a new pretix release, pull the latest code changes and run the following commands:

Make sure to also read Update notes and the release notes of the version you are updating to. Pay special attention to the "Runtime and server environment" section of all release notes between your current and new version.

Install a plugin#

To install a plugin, just use ! Depending on the plugin, you should probably apply database migrations and rebuild the static files afterwards. Replace with the plugin of your choice in the following example:

System updates#

After system updates, such as updates to a new Ubuntu or Debian release, you might be using a new Python version. That's great, but requires some adjustments. First, adjust any old version paths in your nginx configuration file. Then, re-create your Python environment:

Then, proceed like after any plugin installation: