## 1. Project Overview & Quickstart (jetify-com/CONTRIBUTING)

# CONTRIBUTING

Open-source repository jetify-com/CONTRIBUTING

### Repository Details
- **Repository:** [jetify-com/CONTRIBUTING](https://github.com/jetify-com/CONTRIBUTING)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (jetify-com/docs)

## File: docs/devbox/devbox-global/index.mdx

---
title: "Use Devbox as your Primary Package Manager"
  "In addition to managing isolated development environments, you can use Devbox as a general
  package manager. Devbox Global allows you to add packages to a global `devbox.json.` This is
  useful for installing a standard set of tools you want to use across multiple Devbox Projects."
---

For example — if you use ripgrep as your preferred search tool, you can add it to your global Devbox
profile with `devbox global add ripgrep`. Now whenever you start a Devbox shell, you will have
ripgrep available, even if it's not in the project's devbox.json.

<Frame caption="Installing Packages with Devbox Global">
  
</Frame>

You can also use `devbox global` to replace package managers like `brew` and `apt` by adding the
global profile to your path. Because Devbox uses Nix to install packages, you can sync your global
config to install the same packages on any machine.

Devbox saves your global config in a `devbox.json` file in your home directory. This file can be
shared with other users or checked into source control to synchronize it across machines.

## Adding and Managing Global Packages[​](#adding-and-managing-global-packages "Direct link to Adding and Managing Global Packages")

You can install a package using `devbox global add []`, where the package names should be a
list of [Nix Packages](https://search.nixos.org/packages) you want to install.

For example, if we wanted to install ripgrep, vim, and git to our global profile, we could run:

```bash
devbox global add ripgrep vim git

# Output:
ripgrep is now installed
vim is now installed
git is now installed
```

Once installed, the packages will be available whenever you start a Devbox Shell, even if it's not
included in the project's `devbox.json`.

To view a full list of global packages, you can run `devbox global list`:

```bash
devbox global list

# Output:
* ripgrep
* vim
* git
```

To remove a global package, use:

```bash
devbox global rm ripgrep

# Output:
removing 'github:NixOS/nixpkgs/ripgrep'
```

## Using Global Packages in your Host Shell[​](#using-global-packages-in-your-host-shell "Direct link to Using Global Packages in your Host Shell")

If you want to make your global packages available in your host shell, you can add them to your
shell PATH. Running `devbox global shellenv` will print the command necessary to source the
packages.

### Add Global Packages to your Current Host Shell[​](#add-global-packages-to-your-current-host-shell "Direct link to Add Global Packages to your Current Host Shell")

To temporarily add the global packages to your current shell, run:

```bash
. <(devbox global shellenv --init-hook)
```

You can also add a hook to your shell's config to make them available whenever you launch your
shell:

### Bash[​](#bash "Direct link to Bash")

Add the following command to your `~/.bashrc` file:

```bash
eval "$(devbox global shellenv --init-hook)"
```

Make sure to add this hook before any other hooks that use your global packages.

### Zsh[​](#zsh "Direct link to Zsh")

Add the following command to your `~/.zshrc` file:

```bash
eval "$(devbox global shellenv --init-hook)"
```

### Fish[​](#fish "Direct link to Fish")

Add the following command to your `~/.config/fish/config.fish` file:

```bash
devbox global shellenv --init-hook | source
```

## Sharing Your Global Config with Git[​](#sharing-your-global-config-with-git "Direct link to Sharing Your Global Config with Git")

You can use Git to synchronize your `devbox global` config across multiple machines using
`devbox global push <remote>` and `devbox global pull <remote>`.

Your global `devbox.json` and any other files in the Git remote will be stored in
`$XDG_DATA_HOME/devbox/global/default`. If `$XDG_DATA_HOME` is not set, it will default to
`~/.local/share/devbox/global/default`. You can view the current global directory by running
`devbox global path`.

## Next Steps[​](#next-steps "Direct link to Next Steps")

### Learn more about Devbox[​](#learn-more-about-devbox "Direct link to Learn more about Devbox")

- **[Getting Started](/docs/devbox/quickstart/):** Learn how to install Devbox and create your first
  Devbox Shell.
- **[Devbox Scripts](/docs/devbox/guides/scripts/):** Automate setup steps and configuration for
  your shell using Devbox Scripts.
- **[Configuration Guide](/docs/devbox/configuration/):** Learn how to configure your shell and dev
  environment with `devbox.json`.
- **[Browse Examples](https://github.com/jetify-com/devbox-examples):** You can see how to create a
  development environment for your favorite tools or languages by browsing the Devbox Examples repo.
- **[Using Flakes with Devbox](/docs/devbox/guides/using-flakes/):** Learn how to install packages
  from Nix Flakes.

### Use Devbox with your IDE[​](#use-devbox-with-your-ide "Direct link to Use Devbox with your IDE")

- **[Direnv Integration](/docs/devbox/ide-configuration/direnv/):** Devbox can integrate with
  [direnv](https://direnv.net/) to automatically activate your shell and packages when you navigate
  to your project.
- **[Devbox for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=jetpack-io.devbox):**
  Install our VS Code extension to speed up common Devbox workflows or to use Devbox in a
  devcontainer.

### Get Involved[​](#get-involved "Direct link to Get Involved")

- **[Join our Discord Community](https://discord.gg/jetify):** Chat with the development team and
  our growing community of Devbox users.
- **[Visit us on Github](https://github.com/jetify-com/devbox):** File issues and provide feedback,
  or even open a PR to contribute to Devbox or our Docs.

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-global/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/valkey/index.mdx

---
title: "Valkey"
  "Valkey can be configured automatically using Devbox's built in Valkey plugin. This plugin will
  activate automatically when you install Valkey using `devbox add valkey`."
---

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/databases/valkey)

## Adding Valkey to your shell[​](#adding-valkey-to-your-shell "Direct link to Adding Valkey to your shell")

`devbox add valkey`, or in your Devbox.json

```json
    "packages": [
        "valkey@latest"
    ]
```

This will install the latest version of Valkey. You can find other installable versions of Valkey by
running `devbox search valkey`. You can also view the available versions on
[Nixhub](https://www.nixhub.io/packages/valkey)

## Valkey Plugin Details[​](#valkey-plugin-details "Direct link to Valkey Plugin Details")

The Valkey plugin will automatically create the following configuration when you install Valkey with
`devbox add`

### Services[​](#services "Direct link to Services")

- valkey

Use `devbox services start|stop [service]` to interact with services

### Helper Files[​](#helper-files "Direct link to Helper Files")

The following helper files will be created in your project directory:

- \{PROJECT_DIR}/devbox.d/valkey/valkey.conf

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

```bash
VALKEY_PORT=6379
VALKEY_CONF=./devbox.d/valkey/valkey.conf
```

### Notes[​](#notes "Direct link to Notes")

Running `devbox services start valkey` will start valkey as a daemon in the background.

You can manually start Valkey in the foreground by running
`valkey-server $VALKEY_CONF --port $VALKEY_PORT`.

Logs, pidfile, and data dumps are stored in `.devbox/virtenv/valkey`. You can change this by
modifying the `dir` directive in `devbox.d/valkey/valkey.conf`

### Disabling the Valkey Plugin[​](#disabling-the-valkey-plugin "Direct link to Disabling the Valkey Plugin")

You can disable the Valkey plugin by running `devbox add valkey --disable-plugin`, or by setting the
`disable_plugin` field in your `devbox.json`:

```json
{
  "packages": {
    "valkey": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/valkey/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/redis/index.mdx

---
title: "Redis"
  "Redis can be configured automatically using Devbox's built in Redis plugin. This plugin will
  activate automatically when you install Redis using `devbox add redis`."
---

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/databases/redis)

## Adding Redis to your shell[​](#adding-redis-to-your-shell "Direct link to Adding Redis to your shell")

`devbox add redis`, or in your Devbox.json

```json
    "packages": [
        "redis@latest"
    ]
```

This will install the latest version of Redis. You can find other installable versions of Redis by
running `devbox search redis`. You can also view the available versions on
[Nixhub](https://www.nixhub.io/packages/redis)

## Redis Plugin Details[​](#redis-plugin-details "Direct link to Redis Plugin Details")

The Redis plugin will automatically create the following configuration when you install Redis with
`devbox add`

### Services[​](#services "Direct link to Services")

- redis

Use `devbox services start|stop [service]` to interact with services

### Helper Files[​](#helper-files "Direct link to Helper Files")

The following helper files will be created in your project directory:

- \{PROJECT_DIR}/devbox.d/redis/redis.conf

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

```bash
REDIS_PORT=6379
REDIS_CONF=./devbox.d/redis/redis.conf
```

### Notes[​](#notes "Direct link to Notes")

Running `devbox services start redis` will start redis as a daemon in the background.

You can manually start Redis in the foreground by running
`redis-server $REDIS_CONF --port $REDIS_PORT`.

Logs, pidfile, and data dumps are stored in `.devbox/virtenv/redis`. You can change this by
modifying the `dir` directive in `devbox.d/redis/redis.conf`

### Disabling the Redis Plugin[​](#disabling-the-redis-plugin "Direct link to Disabling the Redis Plugin")

You can disable the Redis plugin by running `devbox add redis --disable-plugin`, or by setting the
`disable_plugin` field in your `devbox.json`:

```json
{
  "packages": {
    "redis": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/redis/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/rabbitmq/index.mdx

---
title: "RabbitMQ"
  "RabbitMQ is a reliable message and streaming broker. You can configure RabbitMQ for your Devbox
  project by using our official [RabbitMQ
  Plugin](https://github.com/jetify-com/devbox-plugins/tree/main/rabbitmq)."
---

## Adding RabbitMQ to your shell[​](#adding-rabbitmq-to-your-shell "Direct link to Adding RabbitMQ to your shell")

You can start by adding the RabbitMQ server to your project by running `devbox add rabbitmq-server`.

```json
    "packages": [
        "rabbitmq-server@latest"
    ]
```

You can then add the RabbitMQ Plugin to your devbox.json by adding it to your `include` list:

```json
    "include": [
        "github:jetify-com/devbox-plugins?dir=rabbitmq"
    ]
```

Adding these packages and the plugin will configure Devbox for working with RabbitMQ.

## Starting the RabbitMQ Service[​](#starting-the-rabbitmq-service "Direct link to Starting the RabbitMQ Service")

The RabbitMQ plugin will automatically create a service for you that can be run with
`devbox services up`. The process-compose.yaml for this service is shown below:

```yaml
processes:
  rabbitmq:
    command: "rabbitmq-server"
    availability:
      restart: on_failure
      max_restarts: 5
    daemon: true
    shutdown:
      command: "rabbitmqctl shutdown"
  rabbitmq-logs:
    command: "tail -f $RABBITMQ_LOG_BASE/$RABBITMQ_NODENAME@$(hostname -s).log"
    availability:
      restart: "always"
```

The `rabbitmq` process starts the server as a daemon in the background, and shuts it down whenever
you terminate process compose. The `rabbitmq-logs` service will tail the logs of process-compose,
and display them in the process-compose UI. You can configure the services by modifying the
environment variables as described below.

If you want to create your own version of the RabbitMQ service, you can create a
process-compose.yaml in your project's root, and define a new process named `rabbitmq`. For more
details, see the [process-compose documentation](https://f1bonacc1.github.io/process-compose/)

## Environment Variables[​](#environment-variables "Direct link to Environment Variables")

The plugin will create the following environment variables:

```bash
RABBITMQ_CONFIG_FILE = {{.DevboxDir}}/conf.d
# Points to the directory containing your rabbitmq.conf file

RABBITMQ_MNESIA_BASE = {{.Virtenv}}/mnesia
# Points to the directory where your node database store, and state files will be kept. Changing this variable is not recommended

RABBITMQ_ENABLED_PLUGINS_FILE = {{.DevboxDir}}/conf.d/enabled_plugins
# Tells rabbit mq where to store the file with your enabled plugins

RABBITMQ_LOG_BASE = {{.Virtenv}}/log
# Where the logs for your RabbitMQ instance will be stored

RABBITMQ_NODENAME = rabbit
# Default nodename for your rabbitmq instance. This variable is used in other settings

RABBITMQ_PID_FILE = {{.Virtenv}}/pid/$RABBITMQ_NODENAME.pid
# Creates RabbitMQ's pidfile in a local directory for your project. Changing this is not recommended.
```

You can override the default values of these variables using the `env` section of your `devbox.json`
file. For a full list of environment variables used by RabbitMQ, see the
[RabbitMQ Configuration Docs](https://www.rabbitmq.com/docs/configure#customise-environment).

## Files[​](#files "Direct link to Files")

The plugin will also create a default
[`rabbitmq.conf`](https://github.com/jetify-com/devbox-plugins/blob/main/rabbitmq/config/rabbitmq.conf)
file in your devbox.d directory, if one doesn't already exist there. This default file serves as a
starting point, and you can modify it as needed.

For a full list of configuration options, see the
[RabbitMQ Configuration Docs](https://www.rabbitmq.com/docs/configure)

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/rabbitmq/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/postgres/index.mdx

---
title: "PostgreSQL"
  "PostgreSQL can be automatically configured by Devbox via the built-in Postgres Plugin. This
  plugin will activate automatically when you install Postgres using `devbox add postgresql`."
---

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/databases/postgres)

## Adding Postgres to your Shell[​](#adding-postgres-to-your-shell "Direct link to Adding Postgres to your Shell")

You can install the PostgreSQL server and client by running`devbox add postgresql`. In some Linux
distributions, you may also need to add `glibcLocales`, which can be added using
`devbox add glibcLocales --platform=x86_64-linux,aarch64-linux`.

Alternatively, you can add the following to your devbox.json:

```json
  "packages": {
    "postgresql": "latest",
    "glibcLocales": {
      "version": "latest",
      "platforms": ["x86_64-linux", "aarch64-linux"]
    }
  }
```

This will install the latest version of Postgres. You can find other installable versions of
Postgres by running `devbox search postgresql`. You can also view the available versions on
[Nixhub](https://www.nixhub.io/packages/postgresql)

## PostgreSQL Plugin Support[​](#postgresql-plugin-support "Direct link to PostgreSQL Plugin Support")

Devbox will automatically create the following configuration when you run `devbox add postgresql`:

### Services[​](#services "Direct link to Services")

- postgresql

You can use `devbox services start|stop postgresql` to start or stop the Postgres server in the
background.

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

`PGHOST=./.devbox/virtenv/postgresql` `PGDATA=./.devbox/virtenv/postgresql/data`

This variable tells PostgreSQL which directory to use for creating and storing databases.

### NOTES[​](#notes "Direct link to NOTES")

1. To initialize PostgreSQL run:

```bash
initdb
```

1. You also need to create a user using:

```bash
createuser --interactive
```

1. (OPTIONAL) If the user has no permissions to create or drop a database, you also need to create a
   database using:

```bash
createdb <db-name>
```

#### Using the `createuser` Command[​](#using-the-createuser-command "Direct link to using-the-createuser-command")

Run the createuser command with the `-s` or `--superuser` option to create a superuser. This grants
the user the ability to bypass all access permission checks within the database, effectively
granting them extensive privileges including the ability to create and drop databases. Additionally,
you can use the `-r` or `--createrole` option to allow the user to create new roles. Here's an
example command:

```bash
createuser -s -r your_new_user_name
```

Replace `your_new_user_name` with the desired username for the new superuser.

Remember: Creating a superuser grants them significant power over the database system, so it should
be done cautiously and only when absolutely necessary due to the potential security implications.

### Disabling the Postgres Plugin[​](#disabling-the-postgres-plugin "Direct link to Disabling the Postgres Plugin")

You can disable the Postgres plugin by running `devbox add postgresql --disable-plugin`, or by
setting the `disable_plugin` field to `true` in your package definition:

```json
{
  "packages": {
    "postgresql": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/postgres/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/mysql/index.mdx

---
title: "MySQL"
  "MySQL can be automatically configured for your dev environment by Devbox via the built-in MySQL
  Plugin. This plugin will activate automatically when you install MySQL using `devbox add mysql80`
  or `devbox add mysql57`."
---

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/databases/mysql)

## Adding MySQL to your Shell[​](#adding-mysql-to-your-shell "Direct link to Adding MySQL to your Shell")

`devbox add mysql80`, or in your `devbox.json` add

```json
    "packages": [
        "mysql80@latest"
    ]
```

You can also install Mysql 5.7 by using `devbox add mysql57`

You can manually add the MySQL Plugin to your `devbox.json` by adding it to your `include` list:

```json
    "include": [
        "plugin:mysql"
    ]
```

This will install the latest version of MySQL. You can find other installable versions of MySQL by
running `devbox search mysql80` or `devbox search mysql57`. You can also view the available versions
on [Nixhub](https://www.nixhub.io/packages/mysql80)

## MySQL Plugin Support[​](#mysql-plugin-support "Direct link to MySQL Plugin Support")

Devbox will automatically create the following configuration when you run `devbox add mysql80` or
`devbox add mysql57`. You can view the full configuration by running `devbox info mysql`

### Services[​](#services "Direct link to Services")

- mysql

You can use `devbox services up|stop mysql` to start or stop the MySQL Server.

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

```bash
MYSQL_BASEDIR=.devbox/nix/profile/default
MYSQL_HOME=./.devbox/virtenv/mysql/run
MYSQL_DATADIR=./.devbox/virtenv/mysql/data
MYSQL_UNIX_PORT=./.devbox/virtenv/mysql/run/mysql.sock
MYSQL_PID_FILE=./.devbox/virtenv/mysql/run/mysql.pid
MYSQL_CONF=./devbox.d/mysql/my.cnf
```

### Files[​](#files "Direct link to Files")

The following helper file will be created in your project directory:

- \{PROJECT_DIR}/devbox.d/mysql/my.cnf

The plugin will also create the following helper files in your project's `.devbox/virtenv` folder:

- mysql/flake.nix
- mysql/setup_db.sh
- mysql/process-compose.yaml

These files are used to setup your database and service, and should not be modified

### Notes[​](#notes "Direct link to Notes")

- This plugin wraps mysqld to work in your local project. For more information, see the `flake.nix`
  created in your `.devbox/virtenv/mysql` folder.
- This plugin will create a new database for your project in `MYSQL_DATADIR` if one doesn't exist on
  shell init.
- You can use `mysqld` to manually start the server, and `mysqladmin -u root shutdown` to manually
  stop it
- `.sock` filepath can only be maximum 100 characters long. You can point to a different path by
  setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json` as follows:

```json
"env": {
    "MYSQL_UNIX_PORT": "/<some-other-path>/mysql.sock"
}
```

### Disabling the MySQL PLugin[​](#disabling-the-mysql-plugin "Direct link to Disabling the MySQL PLugin")

You can disable the built-in MySQL plugin using `devbox add mysql80 --disable-plugin`, or by setting
the `disable_plugin` field to `true` in your package definition:

```json
{
  "packages": {
    "mysql80": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/mysql/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/mongodb/index.mdx

---
title: "MongoDB"
  "MongoDB is a popular NoSQL database that is available on Nixpkgs. You can configure MongoDB for
  your Devbox project by using our official [MongoDB
  Plugin](https://github.com/jetify-com/devbox-plugins/tree/main/mongodb)."
---

## Adding MongoDB to your Shell[​](#adding-mongodb-to-your-shell "Direct link to Adding MongoDB to your Shell")

You can start by adding the mongodb server to your project by running `devbox add mongodb`. We also
recommend adding the MongoDB shell for interacting with your database using `devbox add mongosh`:

```json
    "packages": [
        "mongodb@latest",
        "mongosh@latest"
    ]
```

You can add the MongoDB Plugin to your `devbox.json` by adding it to your `include` list:

```json
    "include": [
        "github:jetify-com/devbox-plugins?dir=mongodb"
    ]
```

Adding these packages and the plugin will configure Devbox for working with MongoDB.

## Starting the MongoDB Service[​](#starting-the-mongodb-service "Direct link to Starting the MongoDB Service")

The MongoDB plugin will automatically create a service for you that can be run with
`devbox services up`. The process-compose.yaml for this default service is shown below:

```yaml
processes:
  mongodb:
    command: "mongod --config=$MONGODB_CONFIG --dbpath=$MONGODB_DATA --bind_ip_all"
    availability:
      restart: on_failure
      max_restarts: 5
```

You can configure this service by modifying the environment variable shown below.

If you want to create your own version of the mongodb service, you can create a process-compose.yaml
in your project's root, and define a new process named `mongodb`. For more details, see the
[process-compose documentation](https://f1bonacc1.github.io/process-compose/)

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

The MongoDB plugin will configure the following environment variables

```bash
MONGODB_CONFIG = ./devbox.d/mongodb/mongod.conf
# Tells Devbox where to look for your mongod.conf file

MONGODB_DATA = ./devbox/virtenv/mongodb/data
# Tells Devbox where MongoDB's data directory should be located
```

You can override the default values of these variables using the `env` section of your devbox.json
file.

### Files[​](#files "Direct link to Files")

The plugin will also create a default \[`mongod.conf`] file in your `devbox.d` directory, if one
doesn't already exist there. This default file mostly serves as a placeholder, and you can modify it
as needed.

For a full list of configuration options, see the
[MongoDB documentation](https://www.mongodb.com/docs/v6.0/reference/configuration-options/)

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/mongodb/index.mdx)

---

## File: docs/devbox/devbox-examples/databases/mariadb/index.mdx

---
title: "MariaDB"
  "MariaDB can be automatically configured for your dev environment by Devbox via the built-in
  MariaDB Plugin. This plugin will activate automatically when you install MariaDB using `devbox add
  mariadb`, or when you use a versioned Nix package like `devbox add mariadb_1010`"
---

[**Example Repo**](https://github.com/jetify-com/devbox/tree/main/examples/databases/mariadb)

## Adding MariaDB to your Shell[​](#adding-mariadb-to-your-shell "Direct link to Adding MariaDB to your Shell")

`devbox add mariadb`, or in your `devbox.json` add

```json
    "packages": [
        "mariadb@latest"
    ]
```

You can manually add the MariaDB Plugin to your `devbox.json` by adding it to your `include` list:

```json
    "include": [
        "plugin:mariadb"
    ]
```

This will install the latest version of MariaDB. You can find other installable versions of MariaDB
by running `devbox search mariadb`. You can also view the available versions on
[Nixhub](https://www.nixhub.io/packages/mariadb)

## MariaDB Plugin Support[​](#mariadb-plugin-support "Direct link to MariaDB Plugin Support")

Devbox will automatically create the following configuration when you run `devbox add mariadb`. You
can view the full configuration by running `devbox info mariadb`

### Services[​](#services "Direct link to Services")

- mariadb

You can use `devbox services up|stop mariadb` to start or stop the MariaDB Server.

### Environment Variables[​](#environment-variables "Direct link to Environment Variables")

```bash
MYSQL_BASEDIR=.devbox/nix/profile/default
MYSQL_HOME=./.devbox/virtenv/mariadb/run
MYSQL_DATADIR=./.devbox/virtenv/mariadb/data
MYSQL_UNIX_PORT=./.devbox/virtenv/mariadb/run/mysql.sock
MYSQL_PID_FILE=./.devbox/mariadb/run/mysql.pid
```

### Files[​](#files "Direct link to Files")

The plugin will also create the following helper files in your project's `.devbox/virtenv` folder:

- mariadb/flake.nix
- mariadb/setup_db.sh
- mariadb/process-compose.yaml

These files are used to setup your database and service, and should not be modified

### Notes[​](#notes "Direct link to Notes")

- This plugin wraps mysqld and mysql_install_db to work in your local project. For more information,
  see the `flake.nix` created in your `.devbox/virtenv/mariadb` folder.
- This plugin will create a new database for your project in MYSQL_DATADIR if one doesn't exist on
  shell init.
- You can use `mysqld` to manually start the server, and `mysqladmin -u root shutdown` to manually
  stop it
- `.sock` filepath can only be maximum 100 characters long. You can point to a different path by
  setting the `MYSQL_UNIX_PORT` env variable in your `devbox.json` as follows:

```json
"env": {
    "MYSQL_UNIX_PORT": "/<some-other-path>/mysql.sock"
}
```

### Disabling the MariaDB Plugin[​](#disabling-the-mariadb-plugin "Direct link to Disabling the MariaDB Plugin")

You can disable the MariaDB plugin by running `devbox add mariadb --disable-plugin`, or by setting
the `disable_plugin` field in your `devbox.json`:

```json
{
  "packages": {
    "mariadb": {
      "version": "latest",
      "disable_plugin": true
    }
  }
}
```

[Edit this page](https://github.com/jetify-com/docs/tree/main/docs/devbox/devbox-examples/databases/mariadb/index.mdx)