# Building MariaDB From Source Using musl-based GNU/Linux

## Instructions on compiling MariaDB on musl-based operating systems (Alpine)

The instructions on this page will help you compile [MariaDB](/docs/server/clients-and-utilities/mariadb-client.md) from source.\
Links to more complete instructions for specific platforms can be found on the [source](/docs/server/server-management/install-and-upgrade-mariadb/compiling-mariadb-from-source.md) page.

* First, [get a copy of the MariaDB source](/docs/server/clients-and-utilities/server-client-software/download/getting-the-mariadb-source-code.md).
* Next, [prepare your system to be able to compile the source](/docs/server/server-management/install-and-upgrade-mariadb/compiling-mariadb-from-source/legacy-guides/build-environment-setup-for-linux.md).

## Using `cmake`

[MariaDB 10.1](/docs/release-notes/community-server/old-releases/10.1/changes-improvements-in-mariadb-10-1.md) and above is compiled using *`cmake`*. You can configure your\
build simply by running *`cmake`* using special option, i.e.

```bash
cmake . -DWITHOUT_TOKUDB=1
```

To build and install MariaDB after running *`cmake`* use

```bash
make
sudo make install
```

Note that building with MariaDB this way will disable `tokuDB`, till `tokuDB` becomes fully supported on `musl`.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/server-management/install-and-upgrade-mariadb/compiling-mariadb-from-source/legacy-guides/building-mariadb-from-source-using-musl-based-gnulinux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
