# Applications - Analytics Source: https://docs.sevalla.com/applications/analytics View detailed analytics for your applications, including usage and performance insights. Sevalla charges for [Application Hosting](https://sevalla.com/application-hosting/) based on bandwidth, build time, and application hosting pod usage. With Application Analytics, you can get insights into your application's usage data. For more information about how we calculate your invoice, refer to [Application Pricing](/billing/application-pricing). The application billing amounts are also included in the **Spending overview** chart on your Sevalla Dashboard. This chart shows the spending overview for all Sevalla services. Spending overview for your Sevalla services on your Sevalla Dashboard Spending overview for your Sevalla services on your Sevalla Dashboard ## Application analytics Each application's analytics is broken down into: * **Compute:** The resources you use for your application. * **Web:** Information about the requests to your application. When viewing the application analytics, you can choose to see data for the past 1 hour, 6 hours, 12 hours, 1 day, 2 days, 4 days, 7 days, 14 days, or 30 days, or select a specific date and time period. You can refresh the chart data at any time. When you hover over a chart, a corresponding reference line appears on the other charts on the same page. You can click and drag this reference line to zoom into a specific time period, and all charts on the page will update to show that same time range. To access these in-depth reports, go to your application's **Analytics** page (**Applications** > ***appname*** > **Analytics**). Application-level Analytics in Sevalla Application-level Analytics in Sevalla ### Compute Using the dropdown within Compute, you can view the information for your web process, a background worker, or a cron job. Select **Show limit** to compare your usage with your current plan limit. #### Memory usage The Memory usage chart shows the average of the total memory (RAM) used for the selected time period. If a process uses most or all of the memory available, we recommend upgrading to an [application hosting pod](/billing/application-pricing) with more available memory. Memory chart in application-level analytics Memory chart in application-level analytics #### CPU usage In the CPU usage chart, you can see the average of the total CPU utilization for the selected time period, expressed as a percentage of the instance's CPU resources. If you see a high percentage of CPU usage (near 100%), we recommend upgrading to an [application hosting pod](/billing/application-pricing) with more CPU for that process. If your application is stateless (no [persistent storage](/applications/storage)), you also have the option to enable [automatic horizontal scaling](/applications/scalability) for the **web process**. This lets you set a minimum and maximum number of instances (up to 10) that the process can scale between as needed. CPU usage chart in application-level analytics CPU usage chart in application-level analytics #### Instance count The Instance count chart shows the number of instances in use for the selected process and time period. Select **Show limit** to compare your usage to your process resource limit. You can adjust the number of instances for your process within **Processes**, click the kebab (three dots) on the required process, and select **Update process**. Instance count chart in application-level analytics Instance count chart in application-level analytics ### Web You can filter the web charts using **Add filter**. This filters all of the charts on the **Web** page. The following options are available: * Source IP * Country * Device type * HTTP method * Path * User agent * HTTP version * Status code #### Requests volume by country The Requests volume by country chart displays the number of requests, ranked by the country from which they originated. You can zoom in and out of the map, and hover over a country to see the exact number of requests from that location. You can also filter the chart to include or exclude specific countries. Requests volume by country chart in application-level analytics Requests volume by country chart in application-level analytics #### Requests per minute The Requests per minute chart shows the average requests per minute (RPM) of all HTTP requests for the time period selected. Requests per minute chart in application-level analytics Requests per minute chart in application-level analytics #### Bandwidth The Bandwidth chart shows your bandwidth usage over the selected timeframe. Application Analytics Bandwidth Dark Application Analytics Bandwidth Dark #### Response time The Response time chart shows the average response time for all HTTP requests for the time period selected. Response time chart in application-level analytics Response time chart in application-level analytics #### Status codes The Status codes chart displays the total number of each status code returned for requests. This is useful for analyzing your site to identify when requests return codes other than 200. Status codes chart in application-level analytics Status codes chart in application-level analytics #### Slowest requests The slowest requests table shows the 10 slowest requests to your application for the selected time period and the average response time it took to complete. Slowest requests chart in application-level analytics Slowest requests chart in application-level analytics #### Top pages The Top pages table shows the top 10 most requested pages by the number of views for your application. Top pages chart in application-level analytics Top pages chart in application-level analytics ## Additional notes Analytics data is retained for 30 days. We suggest checking your **Application Analytics** frequently after first deploying to Sevalla and periodically after that. If you see any unexplained analytics data or inconsistencies that concern you, [let our Support team know](/support/contact-support/), and we can further investigate to help determine the cause. # Buildpacks Source: https://docs.sevalla.com/applications/build-options/buildpacks Learn how to use buildpacks to automate your application builds. Sevalla uses [Nixpacks](/applications/build-options/nixpacks) by default to build your application and set up the container image. Sevalla also offers Buildpacks, an open-source project maintained by Heroku, as one of the options to automatically determine and create a container for your application based on your repository. Buildpacks are scripts that are run when your application is deployed to install dependencies for your application and configure your environment. You can choose Buildpacks by changing the **Build environment** option in [application settings](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy**). You can choose which [Heroku builder](https://github.com/heroku/cnb-builder-images) to use for your application. It is your responsibility to ensure this is compatible with your application by checking the Buildpacks and Builder changelogs for your application's language. ## Supported languages We support the following application languages for Buildpacks: * Node.js * Ruby * Python * Java * Scala * PHP * Go If you do not specify a version in your application’s code, the buildpack uses the latest available version. If you want to use a different language version for your application, you’ll need to [set the version in your application’s files](#set-a-buildpacks-language-version). If you want to use a language that is not a supported Buildpack language, you can first check to see if it’s a supported language with [Nixpacks](/applications/build-options/nixpacks) or [Railpack](/applications/build-options/railpack). If it isn’t, you must use a [Dockerfile](/applications/build-options/dockerfile). ## Configure Buildpacks Some applications require no configuration, but some require specialized commands and options to run, such as: [Environment variables](/applications/environment-variables) — You may need to set certain environment variables to run your application. [Processes](/applications/processes) — Sevalla can automatically detect your web process command. You can change this if required, and you can define additional processes. [Processes in a Procfile](/applications/processes#defining-processes-in-a-procfile) — You may want to define your processes in a Procfile within your application’s code. ## Add or edit Buildpacks You can manage buildpacks on your [**application’s Settings page**](/applications/settings/). You can add additional build packs within **Build strategy** > **Update build strategy** > **Add buildpack**. When you add a buildpack, it’s automatically added to the end of the buildpacks list, so you may need to edit the order of your buildpacks. You can drag and drop the buildpacks to change their order, or remove buildpacks within **Build strategy** > **Update build strategy**. The buildpack containing your application's primary language must be the last one in the buildpacks list. For example, if you have a Node.js application and need to add another buildpack, make sure the Node.js buildpack is at the end of the list. ## Buildpack binary directories With buildpacks, the binary directories may differ from the default binary directories for the application language. The following table shows the binary directories used for each buildpack language: | Language | Directory | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Node.js | **/layers/heroku\_nodejs-engine/dist/bin/node** | | Ruby | **/usr/bin/ruby** | | Python | **/usr/bin/python** | | Java | **/layers/heroku\_jvm/openjdk/bin/java** | | Scala | Scala doesn’t have a specific default binary path like some other compiled languages. When you compile a Scala program, it generates bytecode that runs on the Java Virtual Machine (JVM).

The compiled Scala classes are typically stored in a directory structure that mirrors the package structure of your code. This is similar to how Java classes are organized. By default, when you compile a Scala source file, the compiled .class files will be placed in the same directory as the source code (within a subdirectory structure based on the package declarations).

If needed, you can install Scala’s runtime tools using a Dockerfile instead of a buildpack.

| | PHP | **/workspace/.heroku/php/bin/** | | Go | Go doesn’t have a specific default binary path like some other compiled languages. When you compile a Go program, the resulting binary executable is typically placed in the same directory as your source code by default.

If needed, you can install Go’s runtime tools using a Dockerfile instead of a buildpack.

| ## Set a Buildpack’s language version When you select the option to use Buildpacks, if you do not specify a version in your application’s code, the Buildpack will use the latest available version. If you want to use a different language version for your application, you’ll need to set the version in your application’s files. The method for setting the version varies by language. Below we’ve included examples for currently supported languages. ### Go To specify your Go version, include the following in your application’s **go.mod** file: ```text theme={null} // +heroku goVersion go1.11 go 1.21.1 ``` ### Java To specify your Java version, include the following in your application’s **system.properties** file: ```text theme={null} java.runtime.version=11 ``` ### Node.js To specify your Node.js and npm versions, include the following in your application’s **package.json** file: ```text theme={null} "engines": { "node": "^16.14.0", "npm": "^8.3.1" } ``` Specifying the npm version isn’t usually necessary (npm is bundled with Node.js). Setting the npm version is only needed when you want to use a different version than the one bundled with your version of Node.js #### React If you’re using React and want to specify your React version, replace or add the React version in the `dependencies` section of your **package.json** file: ```text theme={null} "react": "^17.0.2" ``` To also set the Node.js and npm versions in your React application, include the following in your application’s **package.json** file: ```text theme={null} "engines": { "node": "^16.14.0", "npm": "^8.3.1" } ``` ### PHP Buildpacks support the currently supported PHP versions; once a PHP version reaches end-of-life, it is no longer supported but remains available so you can upgrade your application to a newer version. To specify your PHP version, include the following in your application’s **composer.json** file: ```text theme={null} { "require": { "php": "~8.1.0" } } ``` #### PHP.ini You can change PHP.ini settings using a `.user.ini` file in the same directory as the `.php` file. For more information about which settings you can control, refer to the [PHP manual](https://www.php.net/manual/en/configuration.file.per-user). A small set of `PHP.ini` configuration directives cannot be modified using `.user.ini`; for example, `PHP_INI_SYSTEM`. In this case, you must pass additional configuration settings for PHP at startup time using a custom configuration file `fpm_custom.conf` with the `php_value` and `php_flag` directives. If you use a custom configuration file, you must tell your application to start with this configuration by adding `-F` to the start command. You can also use this configuration file to modify the [PHP-FPM behavior](https://www.php.net/manual/en/install.fpm.configuration.php). ### Python To specify your Python version, include the following in your application’s **runtime.txt** file: ```text theme={null} python-3.10.13 ``` You can also specify module versions within the **requirements.txt** file: ```text theme={null} Django==4.1 virtualenv==20.18.0 ``` ### Ruby To specify your Ruby version, include the following in your **Gemfile**: ```text theme={null} ruby "3.0.6" ``` ### Scala To specify your Scala version, include the following in your application’s **build.sbt** file: ```text theme={null} scalaVersion := "3.2.2" ``` # Dockerfile Source: https://docs.sevalla.com/applications/build-options/dockerfile Find out how to use Dockerfiles to customize your application builds. Sevalla uses [Nixpacks](/applications/build-options/nixpacks) by default to build your application and set up the container image. You can change this to use a Dockerfile to set up your container image within the application's [Settings](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy**). Using a Dockerfile gives you more control, and you can use almost any language, so you are not restricted to the languages [Nixpacks](/applications/build-options/nixpacks), [Railpack](/applications/build-options/railpack), or [Buildpacks](/applications/build-options/buildpacks) support. A Dockerfile sets up the environment depending on the instructions within the Dockerfile, which must include commands to install the language, adjacent software, and libraries, [set up the port](/applications/networking#edit-application-port), and start the web server. Sevalla automatically sets the `PORT` environment variable. You do not need to define it yourself or hard-code it into the application. For example, in Node.js, use `process.env.PORT` in your code when referring to the server port. Detailed information about how to create a Dockerfile is available in [Docker Docs](https://docs.docker.com/compose/gettingstarted/#step-2-create-a-dockerfile). To use the Web Terminal with an application created with a Dockerfile, make sure Bash is installed in the container. In most cases, the base image (e.g. Ubuntu) includes a shell package and will work by default. In some more streamlined containers, the shell package may not be included, and you’ll need to add it. The base image determines how to add the shell package:Alpine: apk add bashUbuntu/Debian: apt install bashFedora: dnf install bash ## Dockerfile settings To use a Dockerfile, you must change the **Build strategy** in the application's [Settings](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy**). The **Dockerfile path** is the path to your Dockerfile relative to the repository root. For example, if your Dockerfile is in the repository root, enter **Dockerfile** in that field. If your Dockerfile is in a subdirectory named **app**, enter the path to the Dockerfile: **app/Dockerfile**. **Context** is the path in the repository we need access to so we can build your application. Most applications are built from the repository root, and you can enter the repository root (**.**) in the **Context** field. If your application needs to be built from a subdirectory (e.g., **app**), enter that subdirectory path in the **Context** field: **app**. The **Registry credential** is only required for private Docker images. You must enter your registry credentials within **Integration** > **Registry credentials**. Once you’ve entered your credentials in the Company settings, you can choose which credentials you want to use. ## Dockerfile and pnpm If you use [pnpm with a Dockerfile](https://pnpm.io/docker), you must use the following location for `PNPM_HOME`: ```text theme={null} ENV PNPM_HOME="~/.pnpm" ``` ## Example Dockerfile To help get you started, here’s an example Dockerfile you can use for reference or as a starting point. ```text theme={null} FROM node:carbon LABEL maintainer="Sevalla devs" # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in package.json RUN npm install # Run app when the container launches CMD ["npm", "start"] ``` ## Host a database with a Dockerfile If you combine [persistent storage](/applications/storage) and a Dockerfile, you can host pretty much any database you want with our [Application Hosting](https://sevalla.com/application-hosting/). Even something like a Microsoft SQL Server database, which isn’t supported on our [Database Hosting](https://sevalla.com/database-hosting/), can be deployed. If you can containerize it with a Dockerfile, you can deploy it on Application Hosting. Persistent storage is needed to retain the data in your database. If you deploy a database on Application Hosting without persistent storage, all data will be lost if the application is restarted or redeployed. Docker images for many databases can be found at [Docker Hub](https://hub.docker.com/). Look for the [Docker Official Image](https://docs.docker.com/docker-hub/image-library/trusted-content/) badge when searching for a database to get the most secure and well-documented images that follow best practices. # Nixpacks Source: https://docs.sevalla.com/applications/build-options/nixpacks Explore building applications with Nixpacks for flexible and reproducible builds. Sevalla uses Nixpacks, an open-source project maintained by Railway, to automatically create your application’s container image based on your repository. Nixpacks are scripts that are run when your application is deployed to install dependencies for your application and configure your environment. Nixpacks uses fewer resources and supports 20+ languages. If you currently use [Railpack](/applications/build-options/railpack), [Buildpacks](/applications/build-options/buildpacks), or a [Dockerfile](/applications/build-options/dockerfile), you can change this to Nixpacks within the **Build strategy** option in [application settings](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy**). [Railpack](/applications/build-options/railpack), the successor to Nixpacks from the Railway team, is also available as a build type. New applications within Sevalla always use the latest recommended Nixpacks. Sometimes, this may cause changes to the build process; it is your responsibility to keep up-to-date with the latest changes by checking the [Nixpacks changelogs](https://github.com/railwayapp/nixpacks/releases) for your application’s language. You can check and change the Nixpacks version your application uses within **Settings** > **Build strategy** > **Update build strategy**. ## Supported languages Nixpacks supports the following languages: * Clojure * Cobol * Crystal * C#/.NET * Dart * Deno * Elixir * F# * Go * Haskell * Java * Lunatic * Node.js * PHP * Python * Rust * Swift * Scala * Zig If you do not specify a version in your application’s code, Nixpacks will use the current default version. If you have a PHP application with a composer.json file in the repository, it must include a require key with a PHP version. For more details on how to specify the PHP version, see Set a Nixpack’s Language Version below. To use a different language version, [set the version in your application’s files](#set-a-nixpacks-language-version). When using Nixpacks, there usually isn’t a need to choose or add different providers for the build because they are automatically detected. If additional providers are needed for the application, you can define those in a [Nixpacks configuration file](https://nixpacks.com/docs/guides/configuring-builds). If you want to use a language that is not a supported Nixpacks or [Buildpacks](/applications/build-options/buildpacks) language, you must use a [Dockerfile](/applications/build-options/dockerfile). You can change this within **Settings** > **Build strategy** > **Update build strategy**. ## Configure Nixpacks Some applications require no configuration, but some require specialized commands and options to run, such as: [Environment variables](/applications/environment-variables) — You may need to set certain environment variables to run your application. [Processes](/applications/processes) — Sevalla can automatically detect your web process command. You can change this if required, and you can define additional processes. [Processes in a Procfile](/applications/processes#defining-processes-in-a-procfile) — You may want to define your processes in a Procfile within your application’s code. ## Configure builds By adding a `nixpacks.toml` file to your repository, you can customize the final Docker image generated by Nixpacks. This configuration file allows you to specify additional providers, install extra packages, customize your build commands, override the start command, and even define new build phases, giving you greater control over the build process and the resulting image. For more information about how to configure the `nixpacks.toml` file, refer to [Nixpack's documentation](https://nixpacks.com/docs/guides/configuring-builds). ### Nixpacks and pnpm If you use pnpm with Nixpacks, you must use the following location for `PNPM_HOME`: ``` ENV PNPM_HOME="/app/.pnpm" ``` ## Nixpacks binary directories With Nixpacks, the binary directories may differ from the default binary directories for the application language. The following table shows the binary directories used for some of the most common languages: | Language | Directory | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Node.js | **/nix/var/nix/profiles/default/bin/node** | | Ruby | **/nix/var/nix/profiles/default/bin/ruby** | | Python | **/nix/var/nix/profiles/default/bin/python** | | Java | **/nix/var/nix/profiles/default/bin/java** | | Scala | Scala doesn’t have a specific default binary path like some other compiled languages. When you compile a Scala program, it generates bytecode that runs on the Java Virtual Machine (JVM).

The compiled Scala classes are typically stored in a directory structure that mirrors the package structure of your code. This is similar to how Java classes are organized. By default, when you compile a Scala source file, the compiled .class files will be placed in the same directory as the source code (within a subdirectory structure based on the package declarations).

If needed, you can install Scala’s runtime tools using a Dockerfile instead of using a Nixpack.

| | PHP | **/nix/var/nix/profiles/default/bin/php** | | Go | Go doesn’t have a specific default binary path like some other compiled languages. When you compile a Go program, the resulting binary executable is typically placed in the same directory as your source code by default.

If needed, you can install Go’s runtime tools using a Dockerfile instead of using a Nixpack.

| ## Set a Nixpack’s language version When you use Nixpacks, if you do not specify a version in your application’s code, the Nixpack will use the latest available version. If you want to use a different language version for your application, you’ll need to set the version in your application’s files or, depending on the language, with an [environment variable](/applications/environment-variables). The available methods for setting the version vary by language. Below, we’ve included examples for the most common languages. ### Go To specify your Go version, include the following in your application’s **go.mod** file: ``` go 1.18 ``` ### Java To specify your Java version, set the `NIXPACKS_JDK_VERSION` [environment variable](/applications/environment-variables) and make sure the variable is available during the build process. If you’re using Gradle, to specify the version, set the `NIXPACKS_GRADLE_VERSION` [environment variable](/applications/environment-variables) and make sure the variable is available during the build process. ### Node.js To specify your Node.js version, do one of the following: Include the following in your application’s package.json file: ``` "engines": { "node": "18" } ``` Or, set the `NIXPACKS_NODE_VERSION` [environment variable](/applications/environment-variables) and make sure the variable is available during the build process. Only the major version like 14 or 14.x  can be specified. The latest release under that major version will be used. ### PHP Nixpacks only supports PHP version 8.1 or higher To specify your PHP version, include the following in your application’s **composer.json** file: ``` { "require": { "php": "8.2" } } ``` ### Python To specify your Python version, do one of the following: * Include the following in your application’s **runtime.txt** file: `python-3.10.6` * Include the following in a .python-version file in your repository: `3.10.6` * Set the `NIXPACKS_PYTHON_VERSION` [environment variable](/applications/environment-variables) and make sure the variable is available during the build process. ### Ruby To specify your Ruby version, include the version in a **.ruby-version** file in your application, for example: ``` 3.0.6 ``` ### Scala To specify your Scala version, include the following in your application’s **build.sbt** file: ``` scalaVersion := "3.2.2" ``` # Railpack Source: https://docs.sevalla.com/applications/build-options/railpack Build your applications with Railpack, the zero-configuration successor to Nixpacks. Sevalla offers Railpack, an open-source project maintained by Railway and the successor to [Nixpacks](/applications/build-options/nixpacks), to automatically create your application's container image based on your repository. Railpack analyzes your repository and builds an optimized container image with zero configuration, powered by [BuildKit](https://docs.docker.com/build/buildkit/). [Nixpacks](/applications/build-options/nixpacks) remains the default build type for new applications. If you currently use [Nixpacks](/applications/build-options/nixpacks), [Buildpacks](/applications/build-options/buildpacks), or a [Dockerfile](/applications/build-options/dockerfile), you can change this to Railpack within the **Build strategy** option in [application settings](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy**). Railpack is also available through the public API by setting `build_type` to `railpack`. ## Supported languages Railpack detects your application's language based on the files in your repository (for example, `package.json` for Node.js, `go.mod` for Go, or `composer.json` for PHP) and builds the following out of the box: * Node.js * Python * Go * PHP * Java * Ruby * .NET * Deno * Rust * Elixir If you want to use a language that Railpack does not support, check whether it is supported by [Nixpacks](/applications/build-options/nixpacks) or [Buildpacks](/applications/build-options/buildpacks). If it isn't, you must use a [Dockerfile](/applications/build-options/dockerfile). You can change this within **Settings** > **Build strategy** > **Update build strategy**. ## Configure Railpack Some applications require no configuration, but some require specialized commands and options to run, such as: [Environment variables](/applications/environment-variables) - You may need to set certain environment variables to run your application. [Processes](/applications/processes) - Sevalla can automatically detect your web process command. You can change this if required, and you can define additional processes. ## Start command Custom start commands work the same way as with other build types: if your web process has a start command set, it overrides the one Railpack detects. You can change your web process's start command on the [Processes page](/applications/processes). ## Configure builds By adding a `railpack.json` file to the root of your repository, you can customize the final image generated by Railpack. This configuration file allows you to install extra packages, define custom build steps and commands, configure caches, and override the deploy settings, giving you greater control over the build process and the resulting image. For example: ```json theme={null} { "$schema": "https://schema.railpack.com", "steps": { "install": { "commands": ["npm install"] }, "build": { "inputs": [{ "step": "install" }], "commands": ["...", "./my-custom-build.sh"] } }, "deploy": { "startCommand": "node dist/index.js" } } ``` While you can override the start command with `railpack.json` or the `RAILPACK_START_CMD` environment variable, the preferred way is to set the start command for your web process on the [Processes page](/applications/processes). A start command set there always takes precedence. Reference the schema at `https://schema.railpack.com` in your `railpack.json` file to get autocomplete and validation in your editor. For all available options, refer to the [Railpack configuration documentation](https://railpack.com/config/file). ### Build configuration with environment variables You can also customize the build with [environment variables](/applications/environment-variables). Make sure the variables are available during the build process. | Variable | Description | | ------------------------------ | ----------------------------------------------------------------------------------------------------------- | | `RAILPACK_INSTALL_CMD` | Override the command run in the install step. | | `RAILPACK_BUILD_CMD` | Override the command run in the build step. | | `RAILPACK_START_CMD` | Override the command run when the container starts. | | `RAILPACK_PACKAGES` | Install additional [Mise](https://mise.jdx.dev/) packages in the format `pkg@version`, separated by spaces. | | `RAILPACK_BUILD_APT_PACKAGES` | Install additional apt packages during the build, separated by spaces. | | `RAILPACK_DEPLOY_APT_PACKAGES` | Install additional apt packages in the final image, separated by spaces. | For the full list of options, refer to the [Railpack environment variable documentation](https://railpack.com/config/environment-variables). ## Set a Railpack language version If you do not specify a version in your application's code, Railpack uses its current default version for the language. To use a specific version, set it in your application's files or with an [environment variable](/applications/environment-variables). When you use an environment variable, make sure the variable is available during the build process. Railpack also reads [Mise](https://mise.jdx.dev/)-compatible version files, such as `.tool-versions` and `mise.toml`, for most languages. ### Deno To specify your Deno version, include the version in a `.deno-version` file in your repository, or set the `RAILPACK_DENO_VERSION` environment variable. ### Elixir To specify your Elixir version, include the version in a `.elixir-version` file in your repository, set it in your `mix.exs` file, or set the `RAILPACK_ELIXIR_VERSION` environment variable. The Erlang/OTP version is detected automatically from the Elixir version. To override it, include the version in a `.erlang-version` file, or set the `RAILPACK_ERLANG_VERSION` environment variable. ### Go To specify your Go version, include the following in your application's **go.mod** file: ``` go 1.23 ``` Or, set the `RAILPACK_GO_VERSION` environment variable. ### Java To specify your Java version, set the `RAILPACK_JDK_VERSION` environment variable. If you're using Gradle, to specify the Gradle version, set the `RAILPACK_GRADLE_VERSION` environment variable. ### .NET To specify your .NET version, set the `TargetFramework` in your project's **.csproj** file, include the version in your **global.json** file, or set the `RAILPACK_DOTNET_VERSION` environment variable. ### Node.js To specify your Node.js version, do one of the following: Include the following in your application's **package.json** file: ``` "engines": { "node": "22" } ``` Or, include the version in a **.nvmrc** or **.node-version** file in your repository, or set the `RAILPACK_NODE_VERSION` environment variable. Railpack supports npm, pnpm, yarn, and Bun, detected from the `packageManager` field in **package.json** or your lock file. If you use Bun, you can specify the Bun version with the `engines.bun` field in **package.json**, a **.bun-version** file, or the `RAILPACK_BUN_VERSION` environment variable. ### PHP Railpack only supports PHP version 8.2 or higher. To specify your PHP version, include the following in your application's **composer.json** file: ```json theme={null} { "require": { "php": "8.4" } } ``` To install additional PHP extensions, set the `RAILPACK_PHP_EXTENSIONS` environment variable to a comma-separated list, for example `gd,imagick,redis`. ### Python To specify your Python version, do one of the following: * Include the version in a **.python-version** file in your repository: `3.13` * Include the version in a **runtime.txt** file. * Set the `RAILPACK_PYTHON_VERSION` environment variable. Railpack supports pip, poetry, pdm, uv, and pipenv, detected from your dependency files. ### Ruby To specify your Ruby version, include the version in a **.ruby-version** file in your repository, set it in your **Gemfile** (for example, `ruby "3.4.6"`), or set the `RAILPACK_RUBY_VERSION` environment variable. ### Rust To specify your Rust version, set the `channel` in your **rust-toolchain.toml** file, set `rust-version` in your **Cargo.toml** file, include the version in a **.rust-version** file, or set the `RAILPACK_RUST_VERSION` environment variable. For more details about how Railpack builds each language, refer to the [Railpack documentation](https://railpack.com/). # CDN Source: https://docs.sevalla.com/applications/cdn Set up and manage your content delivery network for faster app performance. A content delivery network (CDN) is a crucial component of a modern hosting stack. We're proud to offer a premium CDN powered by Cloudflare for Sevalla's Application Hosting at no additional cost. Our free Cloudflare integration secures your applications hosted on Sevalla. In addition to an enterprise-level firewall and DDoS protection, Sevalla customers also have access to a high-performance HTTP/3 CDN powered by Cloudflare's robust global network. With a network that spans 260+ cities in more than 100 countries, Cloudflare operates one of the largest CDN networks in the world. This means your application will be able to serve static assets from many more locations without the need to pay for additional services. Sevalla's CDN is **not** enabled by default on Application Hosting. The application's **Overview** page shows if the CDN is enabled or disabled. Application Overview page showing CDN is enabled Application Overview page showing CDN is enabled ## Enable or disable Sevalla's CDN To enable the CDN within Sevalla, click **Applications** > **app name** > **Networking**, and within **CDN & Edge caching**, click **Update settings**. Edit the CDN and edge caching settings for your application Edit the CDN and edge caching settings for your application To enable the CDN, select **CDN**. Enable the CDN and edge caching on your application Enable the CDN and edge caching on your application You can also enable or disable the CDN by sending a `POST` request with the [CDN API endpoint](https://api-docs.sevalla.com/v3/applications/toggle-cdn). To access and use the API with your account, you need to generate an API Key under **Integration** > **API keys**. To use the CDN API endpoint, you need your application's unique ID. You can obtain this programmatically by listing all applications associated with your Sevalla company with the [applications endpoint](https://api-docs.sevalla.com/v3/applications/list-applications), which provides essential details about each application. ## File types cached by Sevalla's CDN Files are cached based on the file extension, not the MIME type. We **do not** cache requests or responses containing the `Authorization` header. | 7z | afm | apk | avi | avif | bmp | bz2 | cff | | :---- | :----- | :--- | :-- | :--- | :--- | :--- | :--- | | css | cur | data | dmg | doc | docx | eot | epub | | exe | ffil | flac | flv | gif | glb | gz | heic | | heif | ico | img | iso | jfif | jpeg | jpg | js | | json | lottie | lwfn | m4a | m4v | map | md | mid | | midi | mkv | mov | mp3 | mp4 | mpga | odp | ods | | odt | ogg | ogv | otf | pdf | pfb | pfm | png | | ppt | pptx | pro | qt | rar | rtf | scss | std | | svg | svgz | tar | tgz | tif | tiff | ts | ttf | | txt | usdz | wasm | wav | webm | webp | wmv | woff | | woff2 | xls | xlsx | xml | xsf | zip | zst | | ## Clear the CDN cache Sevalla automatically purges the CDN cache after every successful deploy, so updated content is served without any manual action in most cases. To clear the CDN cache, within Sevalla, click **Applications** > **app name** > **Networking**, and within **CDN & Edge caching**, click **Purge cache**. If both CDN and edge caching are enabled, purging the cache will apply to both. Clear the cache for both CDN and edge caching Clear the cache for both CDN and edge caching You can also clear the CDN cache by sending a `POST` request with the [clear-cache API endpoint](https://api-docs.sevalla.com/v3/applications/purge-edge-cache). If you have enabled [Edge Caching](/applications/edge-caching/), this also clears the Edge Cache. Clearing the CDN Cache in all of Cloudflare's data centers may take 2-5 minutes to fully complete. # Applications - Deployments Source: https://docs.sevalla.com/applications/deployments Track and manage your application deployments with real-time updates. You can manually deploy your application from the **Deployments**, view your application’s deployment history, and view the deployment changes. ## Deploy your application If automatic deployment is enabled, the application deploys every time a commit is made to the branch in the Git repository. You can enable or disable automatic deployments for private Git repositories [**in the application’s Settings**](/applications/settings/). To manually deploy your application, click **Deploy now**, select the branch you want to deploy, and click **Deploy**. If you want to restart your application without rebuilding it, select **Skip building (restart latest)** and click **Deploy**. Manually deploy your application Manually deploy your application ## Zero downtime with health checks If your application includes a health check and you have defined the health check path within the [web process](/applications/processes#web-process), there is zero downtime between deployments. When the application deploys or redeploys, or if the pod restarts, the old pods continue to run until the new pods are ready. You can enable a readiness probe to check if the process is ready to receive traffic; if this fails, the process won't serve requests until it is healthy. You can also enable a liveliness probe to check if the process is still running correctly; if this fails, the process automatically restarts. Implementing health checks for production applications is **strongly recommended** to minimize downtime during deployments and ensure system reliability. Health checks continuously monitor the application’s status, ensuring it remains functional during updates and enabling workloads to be quickly rescheduled at any time, such as during maintenance or unexpected disruptions. This proactive approach helps maintain application stability and delivers a seamless user experience. Zero downtime deployments cannot currently be guaranteed for applications with [persistent disk storage](/applications/storage) attached. If it is an option for your use case, we highly recommend using [object storage](/object-storage) instead of a persistent disk. ## Individual deployment details If you click on any of the previous deployments, you’ll be brought to a dedicated page that shows the deployment log and details for that specific deployment. If the deployment fails, check the deployment log to determine where the process may have encountered an error. ## Deployment logs When you deploy your application to Sevalla, the deployment log shows each step of the deployment and whether it is successful or not. For example, an application using Nixpacks shows the following steps in the deployment log: 1. Fetching source code from GitHub. 2. Source code fetched successfully. 3. Building docker image using Nixpacks. 4. Docker image built successfully. 5. Pushing Docker image to registry. 6. Docker image pushed successfully. 7. Starting rollout. 8. App has been deployed successfully. You can also see the **Build environment** and **Build path**. To change the build environment to use [Railpack](/applications/build-options/railpack), [Buildpacks](/applications/build-options/buildpacks), or a [Dockerfile](/applications/build-options/dockerfile), click **Update build strategy**. If the deployment fails at any stage, the logs display an error message indicating the reason for the failure. For information on troubleshooting errors, refer to [Failed Deployment](/applications/troubleshooting/failed-deployment/). Deployment logs are stored for up to 30 days. The application deployment log for an individual deployment The application deployment log for an individual deployment #### Runtime logs If the deployment is successful, the runtime logs are shown for the deployment. If the deployment is successful but the application fails to run, the runtime logs may show the underlying reason for this. #### Deployment details Individual deployment details Individual deployment details For Git repositories, this shows information such as: * The name of the Git repository and branch. * The Commit ID, with a link to the commit at the Git service provider. * Who initiated the deployment. * The deployment start date and time. * The time it takes for the deployment to finish (**Deploy time**). * The deployment type is either manual or automatic. Automatic deployments only occur if you have selected **Automatic deployment on commit**. * The [data center location](/service-information/data-center-locations/). * The commit message. You can adjust the resource settings, including CPU and RAM allocation for the build process, within the application’s [Settings](/applications/settings/). For Docker images, this shows information such as: * The path to the Docker image. * The deployment start date and time. * The deployment type. * The [data center location](/service-information/data-center-locations/). ## Cancel a deployment There may be times when you need to cancel a deployment of your application. You may want to change the code, or perhaps the deployment is taking longer than expected, and you want to investigate your application’s code. To cancel a deployment, click **Cancel** on the **Deployment is in progress** notification. Cancel a deployment Cancel a deployment You may still incur costs for the build time when you cancel a deployment. ## View the deployment changes Within each individual deployment, you can view the **Changeset**, which displays the changes made to both the runtime and build. Changeset for an individual deployment Changeset for an individual deployment # Docker images Source: https://docs.sevalla.com/applications/docker-images Manage your Docker images and learn how to use them for deployments. When you add an application, you can choose to use a [Git repository](/applications/git/overview) or a Docker image built for Linux/amd64 architecture. Docker images are standalone, executable packages that contain everything you need to run your application, including the code, runtime, libraries, dependencies, and configuration files. They are built from a Dockerfile, which contains instructions for assembling the image layer by layer. Docker images are stored in repositories called registries, such as Docker Hub, where they can be versioned, tagged, and distributed. They can be easily shared and deployed across different environments, making Docker images a portable and scalable solution for packaging and distributing software applications. With Sevalla, you can choose to use a public Docker image from any provider without authentication; however, it's important that you evaluate code quality and security and adhere to licensing and compliance requirements. You can also use a private image from any (or all) of the following registries: * GitHub (ghcr.io) * GitLab (registry.gitlab.com) * Docker Hub (docker.io) Sevalla only supports Docker images built for Linux/amd64 architecture. This is validated when you add an application and during the rollout phase. Private images require authentication through your registry credentials. You can add your registry credentials within **Integration** > **Registry credentials** > **Create registry credential**. Registry credentials within Settings Registry credentials within Settings Complete the fields as follows: * **Name:** Enter a name for the registry credentials to identify them when adding your application. * **Registry:** Choose from one of the following: * DockerHub * GitHub Container Registry * GitLab Container Registry * **Username:** Enter your username for the registry provider. * **Personal access token:** You must obtain this from the registry provider. For more information about how to obtain a personal access token, refer to one of the following: * [DockerHub](https://docs.docker.com/security/access-tokens/) * [GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) * [GitLab](https://docs.gitlab.com/user/profile/personal_access_tokens/) Click **Create registry credential**. Add your registry credentials for the Docker image registry Add your registry credentials for the Docker image registry Once you've added the required registry credentials, you can select the credentials you want to use within **Applications** > ***app name*** > **Settings** > **Build strategy** > **Update build strategy**. # Applications - Domains Source: https://docs.sevalla.com/applications/domains Add and manage custom domains for your applications. When you host your application with Sevalla, it's automatically assigned a free sevalla.app domain as the primary domain upon successful deployment. This allows you to build, test, and preview your application before connecting your custom domain. When you're ready to make your application live, you can add your custom domain on the **Domains** page. Every custom domain you add automatically includes a free SSL certificate. The temporary sevalla.app domains are automatically covered by the wildcard certificate of sevalla.app domain. (\*.sevalla.app). If you want to add a custom SSL certificate, please [contact our Support Team](https://docs.sevalla.com/support/contact-support), who can manually upload this for you. Newly created applications use sevalla.app as the temporary domain. As Sevalla is a [Kinsta](https://kinsta.com) product, we previously used kinsta.app temporary domains for applications. This is a normal part of the Sevalla experience. Your application will still be accessible and manageable through Sevalla's interface even if it uses the kinsta.app domain. If you use a **Hobby** pod for an application's web process, you will **not** be able to add a custom domain to your application. You can upgrade your pod within [Processes](/applications/processes/) at any time in order to add a custom domain. ## Add domain In [Sevalla,](https://app.sevalla.com/) go to **Applications** > ***app name*** > **Domains**. Click **Add custom domain** and enter your domain name. If you want to cover all subdomains, select **Wildcard** and then click **Add custom domain**. If you add your domain without the wildcard subdomain, you should also consider adding the www version of the domain without the wildcard to ensure both versions are correctly configured. Add your custom domain to your application in Sevalla Add your custom domain to your application in Sevalla ## Verify domain To verify your domain, you need to add the records shown to your domain's DNS records: an ownership TXT record, plus an SSL validation record whose type depends on your domain. Some DNS providers, such as [Namecheap](https://www.namecheap.com/), [Spaceship](https://www.spaceship.com/), and [Squarespace](https://www.squarespace.com/) need the short version of DNS record names. Sevalla automatically provides both the full and short versions of each record, so you can use whichever format your DNS provider needs. Verify your domain Verify your domain **Ownership record (TXT)** This TXT record allows Cloudflare to verify that you own the domain and are authorized to use their services for that domain. Once the domain is fully validated, you can remove this record from your DNS if necessary. * Type: `TXT` * Name: `_cf-custom-hostname` * Value: Unique UUID value from Sevalla (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) **SSL validation record (`_acme-challenge`)** Sevalla uses this DNS entry to issue and renew your SSL certificate. As long as this record exists in your DNS, you won't need to manually renew your SSL certificate; Sevalla manages it for you. We don't recommend removing this DNS entry, as you will need to re-add it each time the SSL certificate requires renewal. The record **type depends on whether your domain is a wildcard**. Add it exactly as Sevalla shows it: * **Standard (non-wildcard) domains** - add a **TXT** record: * Type: `TXT` * Name: `_acme-challenge` * Value: the validation token shown in Sevalla * **Wildcard domains** - add a **CNAME** record: * Type: `CNAME` * Name: `_acme-challenge` * Value: `example.com.[unique verification token].dcv.cloudflare.com` Allow 5-10 minutes for DNS to propagate. If propagation doesn't occur as expected, you can use a DNS lookup tool, such as [dnschecker.org](https://dnschecker.org/) or [mxtoolbox.com](https://mxtoolbox.com/), to verify if the record is resolving correctly. ## Point domain Once your domain is successfully verified, you can point it by adding the required A records to your domain's DNS settings. Some DNS providers, such as [Namecheap](https://www.namecheap.com/), [Spaceship](https://www.spaceship.com/), and [Squarespace](https://www.squarespace.com/), need the short version of DNS record names. Sevalla automatically provides both the full and short versions of each record, so you can use whichever format your DNS provider needs. If you select the **Wildcard** option, an additional A record for `*.yourdomain.com` appears to add to your domain's DNS settings, which ensures all subdomains are covered. Point your application domain Point your application domain When the domain is successfully pointed, a success message appears. ### Point WWW domain We recommend that you point the www version of your domain to Sevalla (if you haven't already). To do so, add the www version of the domain to Sevalla and repeat the steps to verify and point the subdomain. ## Proxying through your own Cloudflare (Orange-to-Orange) Sevalla's infrastructure already runs behind Cloudflare. If your DNS is also on Cloudflare and you enable the proxy (orange cloud) on the records that point to Sevalla, your traffic passes through two Cloudflare zones - your own and Sevalla's. This is known as an Orange-to-Orange (O2O) setup, and it comes with trade-offs: * **SSL certificate renewal problems:** Sevalla issues and renews your SSL certificate through the `_acme-challenge` record. When your zone proxies the domain, renewal validation can fail, which can leave your domain with an expired certificate. Always keep the verification records (`_cf-custom-hostname` and `_acme-challenge`) set to **DNS only** (grey cloud). * **Caching issues:** Your Cloudflare zone caches content in front of Sevalla's [CDN](/applications/cdn) and [edge caching](/applications/edge-caching). Purging the cache in Sevalla does not purge your own zone's cache, so visitors can be served stale content, and conflicting cache rules between the two layers can cause unexpected behavior. For most setups, we recommend leaving the records that point to Sevalla set to **DNS only** (grey cloud) and using Sevalla's built-in CDN and edge caching instead. If you keep the proxy enabled, purge the cache in your own Cloudflare zone as well whenever you purge Sevalla's cache or troubleshoot stale content. ## Change your primary domain In the domains list, locate the domain you want to be the primary domain, click the kebab (three-dot) menu, and click **Make primary domain**. Verify that the correct domain is selected, then click **Continue**. Change your primary domain Change your primary domain ## IP address The IP address is shown when you point your domain. We use Cloudflare to secure our hosting infrastructure, so the corresponding IP you see for your application is a Cloudflare IP address. This means the owner of the IP address is Cloudflare, Inc., located in the United States of America. The IP address doesn't reflect the physical place where your application is hosted, nor does it add any further latency to your application. Your application files are stored in the [data center location](/service-information/data-center-locations/) you choose. We do not create copies of your application and store those copies elsewhere. We do not offer dedicated IP addresses because they aren't necessary for most configurations. Since our infrastructure is secured by Cloudflare, sites, applications, and databases hosted on Sevalla use a range of shared IP addresses provided by Cloudflare. Our Cloudflare IP addresses are reserved for Sevalla customers only, so you won't share an IP address with spam or adult sites or applications hosted elsewhere. ## Troubleshoot domain issues Most domain problems happen during verification or pointing, and they usually come down to a conflicting or mis-entered DNS record. Work through the checks below in order. ### Domain won't verify If your domain stays unverified after you've added the records Sevalla shows, check the following: * **Remove any existing A or CNAME record on the root domain.** If your domain already has an A or CNAME record (for example, pointing to a previous host), Cloudflare tries to verify ownership through that record, and verification fails. Remove the old A or CNAME record before verifying, then add the records Sevalla provides. * **Confirm the `_acme-challenge` record uses the correct type.** The required type depends on whether the domain is a wildcard. For a standard (non-wildcard) domain, add `_acme-challenge` as a **TXT** record. For a wildcard domain, add it as a **CNAME** record (its value ends in `dcv.cloudflare.com`). Always match the exact record type Sevalla shows - using the wrong type prevents the SSL certificate from being issued. * **Disable the Cloudflare proxy on the verification records.** If you use Cloudflare as your DNS provider, set the verification records to **DNS only** (grey cloud). Proxied (orange cloud) records don't resolve publicly, so verification can't complete. You can re-enable the proxy on your A or CNAME records after the domain is active. * **Remove conflicting or stale records.** If you previously added and removed this domain in Sevalla, an old `_cf-custom-hostname` TXT value may still be in your DNS. Delete any outdated `_cf-custom-hostname` or `_acme-challenge` records and re-add the exact values shown in Sevalla. * **Confirm the value matches exactly.** Copy the value directly from Sevalla. A trailing space, a missing character, or a wrong record name causes verification to fail. * **Check the Time-to-Live (TTL) setting.** This controls how long internet providers and other services remember your DNS settings before checking for updates. It is usually set to Auto or 5 minutes, but if it has been changed to a longer period, DNS propagation can take longer to take effect. Allow 5-10 minutes after each change for DNS to propagate. Use [dnschecker.org](https://dnschecker.org/) or [mxtoolbox.com](https://mxtoolbox.com/) to confirm a record resolves before assuming it's wrong. ### SSL certificate isn't issued Sevalla issues and renews your SSL certificate automatically once the domain is verified. If the certificate stays pending: * Keep the `_acme-challenge` record in place (a TXT record for standard domains, or a CNAME record for wildcard domains). Removing it stops Sevalla from renewing your certificate, and you would need to re-add it. * Check for a CAA record conflict, described in **Fix domain error** below. ### Fix domain error (CAA record conflict) During the domain verification process, if a **Fix domain error** button appears next to the domain, this means a CAA record conflict is occurring. A CAA record is an optional DNS record that lets you specify which certificate authorities (CAs) are allowed to issue SSL certificates for your domain. If a domain has no CAA records, any CA can generate an SSL certificate for it if requested. If a domain has a CAA record, only the CA(s) specified in the CA record can generate an SSL certificate for the domain. To resolve this error, click the **Fix domain error** button and update the CAA record as indicated in the modal/pop-up. Alternatively, if you do not need a CAA record on your domain, you can remove the CAA record. ### Domain verified, but the application doesn't load If the domain verifies but doesn't serve your application: * Confirm the A record (or CNAME) matches the exact value shown on the **Point domain** step in Sevalla. If you reused an old record, update it. * If you use the Cloudflare proxy, make sure it's enabled only on the A or CNAME records that point to Sevalla, not on the verification records. * For wildcard domains, confirm you also added the `*.yourdomain.com` A record. ### Check your DNS records You can see what's actually published for your domain with these commands: ```bash theme={null} dig +short yourdomain.com A # Existing A record (remove before verifying) dig +short yourdomain.com CNAME # Existing CNAME (remove before verifying) dig +short _cf-custom-hostname.yourdomain.com TXT # Ownership TXT - must match the value in Sevalla dig +short _acme-challenge.yourdomain.com TXT # SSL validation - standard (non-wildcard) domains dig +short _acme-challenge.yourdomain.com CNAME # SSL validation - wildcard domains ``` If the published values don't match what Sevalla shows, update your DNS records and wait for propagation. If they match and the domain still won't verify, [contact our Support Team](https://docs.sevalla.com/support/contact-support). # Edge caching Source: https://docs.sevalla.com/applications/edge-caching Optimize your content delivery using edge caching strategies. Edge Caching saves your Sevalla site/page cache (which is only saved to your site's data center) to any of Cloudflare's global network of 260+ data centers. When your visitors load your application in their browser, cached responses will be delivered from the location closest to them, increasing the performance and speed of your application. Edge Caching serves your Sevalla site/page cache but does not serve static assets like images, JavaScript files, and CSS files. Sevalla's [CDN](/applications/cdn/), which is independent of Edge Caching, can be enabled to serve your static assets. If Sevalla CDN is enabled, your site has an additional caching layer managed separately from Edge Caching. When you clear the Edge Cache for applications, this also clears the CDN cache. Edge Caching is **not** enabled by default on Application Hosting. The application's **Overview** page shows if Edge Caching is enabled or disabled. Application Overview page showing Edge caching is enabled Application Overview page showing Edge caching is enabled ## Enable or disable edge caching To enable edge caching within Sevalla, click **Applications** > **app name** > **Networking**, and within **CDN & Edge caching**, click **Update settings**. Edit the CDN and edge caching settings for your application Edit the CDN and edge caching settings for your application To enable edge caching, select **Edge caching**. Enable the CDN and edge caching on your application Enable the CDN and edge caching on your application ## Clear edge cache Sevalla automatically purges the edge cache after every successful deploy, so updated content is served without any manual action in most cases. To clear the edge cache, within Sevalla, click **Applications** > **app name** > **Networking**, and within **CDN & Edge caching**, click **Purge cache**. If both CDN and edge caching are enabled, purging the cache will apply to both. Clear the cache for both CDN and edge caching Clear the cache for both CDN and edge caching You can also clear the Edge Cache by sending a `POST` request with the [clear-cache API endpoint](https://api-docs.sevalla.com/v3/applications/purge-edge-cache). If you have enabled the [CDN](/applications/cdn/), this also clears the CDN cache. Clearing Edge Cache in all of Cloudflare's data centers may take 2-5 minutes to fully complete. # Applications - Environment variables Source: https://docs.sevalla.com/applications/environment-variables Set and manage environment variables for your app configurations. Environment variables are useful for feeding your application information from outside the running of that application. They are typically used to set things like database connection details and API keys. You can access your environment variables within **Applications** > ***app name*** > **Environment variables**. **Copy all** copies all environment variables, allowing you to paste them elsewhere. **Export to file** exports all the environment variables; if you only want to export certain values, select the required environment variables and then click **Export to file**. You cannot use a `.env` file to pass environment variables to the application; you must set them in Sevalla. You can import the contents of a `.env` file when you add environment variables. Environment variables for your application Environment variables for your application ## Special characters in environment variables In the environment variable keys, you can only use a-z, 0-9, or underscore (`_`). Environment variable values are applied literally, with the exception of parentheses, commas, and double quotes. ### Parentheses Parentheses can cause the build or rollout process to fail, depending on when they are available during deployment. They cannot be used in environment variables. ### Commas Unescaped [commas are interpreted as delimiters](/applications/troubleshooting/failed-deployment#environment-variables) and cannot be used in environment variables. * For example: `write_stock,read_orders` will cause the rollout process to fail. * To keep a comma inside a string, escape it with a backslash (`\`) like this: `write_stock\,read_orders` — which will be applied as `write_stock,read_orders`. ### Double quotes Unescaped double quotes are either disregarded or will cause the rollout process to fail. * For example, `"my_example_variable"` will be applied as `my_example_variable`. * To keep double quotes around a variable, escape them with a backslash (`\`) like this: `\"my_example_var\"` — which will be applied as `"my_example_var"`. * If double quotes are inside of a string (e.g. `my_exampl"e_text`), the [rollout process will fail](/applications/troubleshooting/failed-deployment). * To keep double quotes inside a string, escape them with a backslash (`\`) like this: `my_examp\"le_var` — which will be applied as `my_examp"le_var`. ### Base64 encoded variables If your environment variable is Base64 encoded and you experience issues (e.g. 500 errors in the browser, build errors, runtime errors, etc.), try wrapping the value of the variable with single quotes. ## Add environment variables If you use a Dockerfile to build your application and you want the environment variable to be available during build time, you must add ARG ENVVAR\_XY to your Dockerfile, where ENVVAR\_XY is the environment variable. For example, if your environment variable is DB\_CONNECTION\_URL you would need to add ARG DB\_CONNECTION\_URL. To add environment variables, click **Add environment variables**. Add the key-value pairs in the **Add environment variable** modal/pop-up window, select if the variables are to be available during runtime and/or the build process, and click **Add environment variables**. You can reference another environment variable using the `${key}` format. For example, to reference an environment variable with the key `DB_PASSWORD` use `${DB_PASSWORD}`. To add multiple environment variables, copy the keys and values using CMD + C (Mac) or CTRL + C (Windows), and in the **Add environment variable** window, press CMD + V (Mac) or CTRL + V (Windows). You can also paste the contents of a `.env` file or import the `.env` file using **Import .env**. Add environment variables to your application Add environment variables to your application To deploy the changes, click **Deployments** > **Deploy now**. ## Edit environment variables You can edit variable names (keys) or values on the **Environment variables** page. To edit a variable, click the ellipsis (three dots) and click **Update**, make your changes, and click **Update environment variable**. To deploy the changes, click **Deployments** > **Deploy now**. When you create an [internal connection](/applications/networking/) and select the **Add environment variables…** checkbox, the variable names (keys) are automatically created. Some applications may expect environment variables with different names. For example, if you want to use a database with Laravel, the **database.php** file contains variable names different from those automatically created in Sevalla. To use the variable names defined in the application, edit each variable as needed and change the key to match what's defined in the **database.php** file. ## Use environment variables How you use environment variables depends on your application. In Node, for example, you can access a variable named `API_KEY` with `process.env.API_KEY`. In PHP, you would use `getenv('API_KEY')`. ## Environment variables set by Sevalla The following environment variables are automatically injected into applications during both the **build** and **runtime** phases: * `SVL_COMPANY_ID` * `SVL_APP_ID` * `SVL_APP_NAME` * `SVL_PROCESS_ID` * `SVL_PROCESS_TYPE` * `SVL_DEPLOYMENT_ID` * `SVL_DEPLOYMENT_INITIATED_BY` * `SVL_DEPLOYMENT_TRIGGER` * `SVL_DEPLOYMENT_COMMIT_SHA` * `SVL_DEPLOYMENT_BRANCH` * `SVL_DEPLOYMENT_DOCKER_IMAGE` These variables make it easier to automate tasks, track deployments, and access key deployment metadata directly from within your application. Sevalla always sets `PORT` as the [port used by the web server](/applications/networking#edit-application-port). If you'd like your application to interact with the web server, you will need to use this environment variable. For example, in Node.js, this is how you would start a server: ```javascript theme={null} app.listen(process.env.PORT, () => { console.log("Weather server is up and running") }) ``` ## Environment variables not set by Sevalla By default, the `NODE_ENV` environment variable is **not** set to `production` for Node.js applications, you must add this environment variable manually. ## Environment variable language examples How you use environment variables depends on your application. The following table shows how to call an environment variable named API\_KEY in various languages: | Language | Code | | -------- | --------------------------- | | Ruby | `ENV["API_KEY"]` | | Node.js | `process.env.API_KEY;` | | Python | `os.environ.get('API_KEY')` | | Java | `System.getenv("API_KEY");` | | Scala | `System.getenv("API_KEY");` | | PHP | `getenv('API_KEY');` | | Go | `os.Getenv("API_KEY")` | # Add an application Source: https://docs.sevalla.com/applications/get-started/add-an-application Follow this guide to add a new application to the platform. To help get you started and provide examples of minimal applications, you can use one of the Sevalla one-click templates from your **Dashboard** or from **Templates**. To access these templates, you must have a valid payment method on your account. Sevalla Templates Sevalla Templates Click on one of the template options, and this automatically starts the application deployment. To add an application, log in to [Sevalla](https://app.sevalla.com/) and click **Applications** > **Create** > **Application**. When you add an application, you can choose to link a [Git repository](/applications/git/overview) or Docker image; the add application workflow differs depending on which option you choose. ## Add an application using a private Git repository Add a new application using a private Git repository Add a new application using a private Git repository * **Git provider:** Choose [GitHub](/applications/git/github), [Bitbucket](/applications/git/bitbucket), or [GitLab](/applications/git/gitlab) and connect your account. * **Repository** and **Branch:** Choose a Git repository and a default branch. If the repository selector is blank, this may be because the account is new; for security, the creation date must be more than 30 days ago. If it is less than 30 days and you want to connect the Git account to Sevalla, ensure you have a valid [payment method](/billing/payments) on your Sevalla account and contact [Sevalla’s Support Team](/support/contact-support). * **Auto-deploy:** Select this option to automatically deploy each time a commit is made to the selected branch. * **Name:** This name will be displayed in Sevalla for easy reference. * **Project:** This option is only shown if your company already has at least one project. Select the project you’d like to add the application to, or leave it blank to keep the application at the company level instead of assigning it to a specific project. * **Location:** Choose the [data center](/service-information/data-center-locations/) you want to use for this application. Currently, internal connections are only supported between applications and databases in the same region. If you'd like to use a database with your application, you can create the database at Sevalla and use an internal connection between the two (on the application's Settings page or the database's Info page). * **Resource:** Choose the pod size for your process. This determines the CPU and RAM dedicated to the process. If you choose a **Hobby** pod size for your web process, you will **not** be able to [add a custom domain to your application](/applications/domains/). However, if you need a custom domain for your application, you can upgrade it anytime. **Overview** allows you to review your application's costs. Click **Create application**. Once you've created your application, you can add [environment variables](/applications/environment-variables/), background workers, cron jobs, or jobs within the [Processes](/applications/processes/) page, and [persistent storage](/applications/storage). If your application is stateless (no persistent storage), you can also enable [automatic horizontal scaling](/applications/scalability) for the **web process** within **Processes**. This lets you set a minimum and maximum number of instances (up to 10) that the process can scale between as needed. Once you have everything set up for your application, you can deploy it from the **Overview** or **Deployments** page. ## Add an application using a public Git repository Add a new application using a public Git repository Add a new application using a public Git repository * **Repository URL** and **Branch**: Enter the **Repository URL** and choose a **Branch**. * **Name:** This name will be displayed in Sevalla for easy reference. * **Project:** This option is only shown if your company already has at least one project. Select the project you’d like to add the application to, or leave it blank to keep the application at the company level instead of assigning it to a specific project. * **Location:** Choose the [data center](/service-information/data-center-locations/) you want to use for this application. Currently, internal connections are only supported between applications and databases in the same region. If you'd like to use a database with your application, you can create the database at Sevalla and use an internal connection between the two (on the application's Settings page or the database's Info page). * **Resource:** Choose the pod size for your process. This determines the CPU and RAM dedicated to the process. If you choose a **Hobby** pod size for your web process, you will **not** be able to [add a custom domain to your application](/applications/domains/). However, if you need a custom domain for your application, you can upgrade it anytime. **Overview** allows you to review your application's costs. Click **Create application**. Once you've created your application, you can add [environment variables](/applications/environment-variables/), background workers, cron jobs, or jobs within the [Processes](/applications/processes/) page, and [persistent storage](/applications/storage). If your application is stateless (no persistent storage), you can also enable [automatic horizontal scaling](/applications/scalability) for the **web process** within **Processes**. This lets you set a minimum and maximum number of instances (up to 10) that the process can scale between as needed. Once you have everything set up for your application, you can deploy it from the **Overview** or **Deployments** page. ## Add an application using a Docker image Sevalla only supports Docker images built for Linux/amd64 architecture. This is validated when you add an application and during the rollout phase. Add a new application using a Docker image Add a new application using a Docker image * **Docker image:** Enter the path to the Docker image. You can use public Docker images from any registry provider. You can access private Docker images from GitHub (ghcr.io), GitLab (registry.gitlab.com), or Docker Hub (docker.io) registries. * **Registry credential (optional):** This is only required for private Docker images. You must enter your registry credentials within **Integration** > **Registry credentials**. Once you've entered your credentials in the Company settings, you can choose which credentials you want to use. * **Name:** This name will be displayed in Sevalla for easy reference. * **Project:** This option is only shown if your company already has at least one project. Select the project you’d like to add the application to, or leave it blank to keep the application at the company level instead of assigning it to a specific project. * **Location:** Choose the [data center](/service-information/data-center-locations/) you want to use for this application. Currently, internal connections are only supported between applications and databases in the same region. If you'd like to use a database with your application, you can create the database at Sevalla and use an internal connection between the two (on the application's Settings page or the database's Info page). * **Resources:** Choose the pod size for your process. This determines the CPU and RAM dedicated to the process. If you choose a **Hobby** pod size for your web process, you will **not** be able to [add a custom domain to your application](/applications/domains/). However, if you need a custom domain for your application, you can upgrade it anytime. **Overview** allows you to review your application's costs. Click **Create application**. Once you've created your application, you can add [environment variables](/applications/environment-variables/), background workers, cron jobs, or jobs within the [Processes](/applications/processes/) page, and [persistent storage](/applications/storage). If your application is stateless (no persistent storage), you can also enable [automatic horizontal scaling](/applications/scalability) for the **web process** within **Processes**. This lets you set a minimum and maximum number of instances (up to 10) that the process can scale between as needed. Once you have everything set up for your application, you can deploy it from the **Overview** or **Deployments** page. ## View app Once your application is successfully deployed, you can open it using **View** at the top of the **Overview** page within the application in Sevalla. The **Overview** page also shows you a diagram of your application so you can easily visualize its components and which [ports](/applications/networking#edit-application-port) it is listening on for incoming requests. Open your application from the Overview page Open your application from the Overview page # Checklist Source: https://docs.sevalla.com/applications/get-started/checklist Use this checklist to verify your application setup and deployment. Follow the go-live checklist to ensure you have everything ready to get your application up and running quickly on Sevalla's Application Hosting. If you run into any problems or have questions, we're happy to help. To help you get started with Application Hosting, you can use one of our [example templates](/templates/overview), a public Git repository, or a Docker image. ## 1. Git repository or Docker image You must ensure the application you want to host exists within a Git repository or Docker image. If you use a public Git repository, you need the URL and branch of the repository. If you want to use a private Git repository, you must select a Git service provider and repository from your account. You can choose from any (or all) of the following: * [Bitbucket](/applications/git/bitbucket) * [GitHub](/applications/git/github) * [GitLab](/applications/git/gitlab) If you use a public Docker image, you need the path to the Docker image. If you want to use a private Docker image, you must add your registry credentials within **Integration** > **Registry credentials**. You can choose from any (or all) of the following registries: * GitHub (ghcr.io) * GitLab (registry.gitlab.com) * Docker Hub (docker.io) ## 2. Environment variables Ensure you have all of the required [Environment variables](/applications/environment-variables/) for your application. Environment variables feed your application information from outside of the running of the application. They typically set things like database connection details and API keys. ## 3. Build path An incorrect build path can cause the application deployment to fail. This is the path in the repository to the files required to build the application. Most applications are built from the repository root, and the **Build path** defaults to this (.). If you have a different build path, you must specify this within [**Settings**](/applications/settings/) (**Settings** > **Build strategy** > **Update build strategy** > **Build path**). For example, if your application needs to be built from a subdirectory (e.g. **app**), enter that subdirectory path in the **Build path** field: **app**. ## 4. Start command or ENTRYPOINT The **Start command** for the [web process](/applications/processes/) starts your application. If this is incorrect, the application will not run. You can specify the Start command within **Processes** > **Web process** > **Update process**. If your application uses a [Dockerfile](/applications/build-options/dockerfile) to set up your container image, you must specify the `ENTRYPOINT` in the Dockerfile to run a container. For more information about how to specify your application's `ENTRYPOINT`, see the [Dockerfile reference](https://docs.docker.com/reference/dockerfile/#entrypoint). ## 5. Background workers and cron jobs Determine if your application requires additional processes like a [background worker](/applications/processes#background-worker) or [cron job](/applications/processes#cron-job-process); you can add these on your application's [Processes](/applications/processes) page. ## 6. Disk or persistent storage If your application requires [persistent storage](/applications/storage), you can add this to your web process and background workers within **Disks**. If you require persistent storage, you need to know the location of the files within your application to be added to the persistent storage disk, so you can specify this in the **Mount path**. ## 7. Add your domain to Sevalla After you've confirmed your site is all good, it's time to go live with your custom domain. Check out our [Application - Domains guide](/applications/domains/). # Applications - Features Source: https://docs.sevalla.com/applications/get-started/features Discover the platform features that make your app development easier. Sevalla's Application Hosting supports a Git-based workflow and lets you deploy your site to one of [25 data centers](/service-information/data-center-locations/). You can deploy almost any application directly from source code right onto Sevalla infrastructure. You can choose the [resources](https://sevalla.com/application-hosting/pricing/) to best suit your application requirements, including options for a Hobby pod, standard pods, memory-optimized pods, and CPU-optimized pods. Each application pod has a predefined amount of CPU cycles, RAM, and build time. Application Hosting includes the following features: * **Unlimited users**: You can invite as many [users](/company-settings/user-management/) as required to your company or site with different levels of access, depending on what their role is. * **Unlimited applications**: You can [add as many applications](/applications/get-started/add-an-application) as you want within your company, each with the resources required for the specific application, including multiple processes per application. * **Unlimited concurrent builds**: You can build and deploy multiple applications simultaneously, and they don't impact one another. * **Unlimited domains**: If you have a standard, memory-optimized, or CPU-optimized pod, you can add as many [domains](/applications/domains/) as required to each application. * **Unlimited background workers, cron jobs, and jobs**: You can add as many [background workers, cron jobs, or job processes](/applications/processes/) as required for your application. Each process requires at least one pod to run, and you can specify the pod size and instances for each process. * **Pipelines:** Use [pipelines](/applications/get-started/pipelines/) to seamlessly push changes from your source code to QA and production environments without needing to rebuild the application. * **Persistent storage**: You can add a [storage volume](/applications/storage) to your web process or background workers that retains data even if the application is restarted or redeployed to create stateful applications. You can only have one storage volume per process with a disk size of up to 1 TB. * **Automatic setup of environment and dependencies**: When you add your application from a Git repository, you can choose from [Nixpacks](/applications/build-options/nixpacks), [Railpack](/applications/build-options/railpack), or [Buildpacks](/applications/build-options/buildpacks) to automatically install dependencies for your application and configure your environment based on your repository. Nixpacks supports over 20 languages, Railpack supports 10, and Buildpacks supports 7; if you want to use a language that Nixpacks, Railpack, or Buildpacks do not support, you can also use a [Dockerfile](/applications/build-options/dockerfile) to set up your container image. This means you can use almost any language in your application and host it on Sevalla. * **Zero downtime deployments and continuous monitoring with healthcheck:** If your application includes a [healthcheck](/applications/deployments#zero-downtime-with-healthchecks), when you deploy or redeploy, the application continues to run until the new pods are ready. The healthcheck also continuously monitors the application and restarts the pods if it fails to respond. * **Analytics**: Sevalla's [Analytics](/databases/analytics) provides you with in-depth information about your application's usage. * **Private network**: If you host both your database and application on Sevalla, you can set up an [internal connection](/applications/networking/) to create a private network so everything is on the same cluster and you don't get charged for ingress traffic. # Applications - Infrastructure Source: https://docs.sevalla.com/applications/get-started/infrastructure Get details about the infrastructure powering your apps. When you host your application or database with Sevalla, your projects run on Sevalla’s top-tier infrastructure. In this guide, we'll dive a little into the details of our Application Hosting and Database Hosting infrastructure. Sevalla Web App Hosting Architecture ## Git repository or Docker image The application's code can be stored within a public or private Git repository or Docker Image. For private Git repositories, you can choose from any (or all) of the following: * [Bitbucket](/applications/git/bitbucket) * [GitHub](/applications/git/github) * [GitLab](/applications/git/gitlab) Docker images must be built for Linux/amd64 architecture. For private Docker images you can choose from any (or all) of the following registries: * GitHub (ghcr.io) * GitLab (registry.gitlab.com) * Docker Hub (docker.io) ## Sevalla add/deploy application In Sevalla, when you [add an application](/applications/get-started/add-an-application), it connects to the Git repository or Docker image to retrieve the application. ## Sevalla bot If you have an application using a Git repository with Automatic deployment on commit enabled within the [application's settings](/applications/settings/), the Sevalla bot detects if you commit a change or merge to your repository; it then pulls the application from your Git service provider and deploys the updated version of the application. ## Sevalla build system Sevalla builds an image of the application from the code. It knows what applications or modules to install for the application from the information in the [Nixpacks](/applications/build-options/nixpacks), [Railpack](/applications/build-options/railpack), [buildpacks](/applications/build-options/buildpacks) or [Dockerfile](/applications/build-options/dockerfile). The output is an image that can be turned into a container. ## Artifact registry This stores the container images that are ready to deploy. Each application has a single image that can be used whenever it needs to be deployed. ## Kubernetes cluster The image from the artifact registry is pushed to the cluster. This is a virtual machine (VM) where multiple containers can run. The clusters are tuned to ensure the request from the artifact registry finds the right container, the containers are running, and they have the right resources. If there are any issues with a container, the application is redeployed to another container. We use cri-o v1.23.x on our infrastructure; however, this version is not static and may be upgraded as we upgrade different components in the stack. Our Kubernetes infrastructure supports a multi-tenant setup, where each application runs in its own containerized environment. Network isolation and multi-layer virtualization ensure security and prevent unauthorized access between applications. This design provides you with a reliable and secure hosting platform, enabling you to focus on your core business while we handle the underlying infrastructure. We deploy at least one cluster per region, with the potential for additional clusters based on the number of applications in each region. This system ensures optimal resource allocation and scalability to meet the growing needs of our clients. ## Cloudflare When a visitor accesses the website for an application, it first accesses Cloudflare, which knows which cluster hosts the website. It then sends the access request to the correct cluster. Currently, for Application Hosting and Database Hosting, Cloudflare includes the default firewall rules, the default DDoS protection, and other defaults. ## Cloud load balancing Each cluster has a load balancer that receives the access request from Cloudflare and randomly pushes a VM worker node. ## Ingress The VM worker node receives the request on the Ingress system, which knows which container is responsible for the hostname being requested. The Ingress system sends the request to the correct container, and if the container has a database attached, it communicates with the database and sends a response on the same route. ## Virtual Machines (VM) A virtual machine (VM) can hold multiple containers and multiple databases. ## Containers Each container or application can have multiple copies on the VM. In this case, the Ingress system knows this and randomly sends through one of the copies of the same container. ## Persistent storage You can add [persistent storage](/applications/storage) to a web process or background processes. This adds a storage volume that is attached to the VM (virtual machine) for your application and retains data even if the application is restarted or redeployed. # Pipelines Source: https://docs.sevalla.com/applications/get-started/pipelines Set up deployment pipelines for continuous delivery and integration. Pipelines enable you to automate the entire process of moving code from development to production. You can define multiple stages within your pipeline and include multiple applications in each stage. Once your pipeline is set up, the **Promote** feature allows you to seamlessly push changes from the source code to QA and production environments without the need to rebuild the application. Pipelines also support the Git Flow strategy, providing a clear visual representation of your application's development and deployment workflow. With pipelines, you can: * **Deploy software with different environment variables:** This is ideal for scenarios like a B2B application used by multiple customers, where each customer requires slight variations in their dashboard. * **Deploy the same application across multiple geographical locations:** This helps improve performance and reduce latency for users in different regions. * **Run A/B tests:** Easily deploy different versions of your application to targeted user groups so you can test which version delivers better results. Using pipelines streamlines the deployment process, enhances flexibility, and supports a structured approach to managing multiple environments. With Pipelines, applications are **free** until they are deployed. Billing only begins once a deployment takes place and the application is actively running. The **Promote** feature is also [accessible through our API](https://api-docs.sevalla.com/v3/pipelines/promote-pipeline), making it easy to integrate with third-party CI/CD tools like GitHub Actions for streamlined workflows. Watch our video to see how to create a delivery pipeline for a Laravel application hosted on Sevalla.