# Configure Alpine with Nexus

Configure your Alpine client to connect to a Nexus Alpine repository. Alpine uses the `/etc/apk/repositories` file to define repository endpoints. Note that you must create an Alpine repository in Nexus before configuring your Alpine client to connect to it. Refer to [Create an Alpine Repository](https://help.sonatype.com/en/create-an-alpine-repository.html "Create an Alpine Repository") for more details.

## Configure the Alpine Repository URL

Use the following syntax to configure an Alpine repository URL:

```
https://<nexus-host>/repository/<repository-name>/<alpine-version>/<channel>
```

Where,

- `<nexus-host>` \- Host name and port for your Nexus Repository instance

- `<repository-name>` \- Target Alpine repository in Nexus

- `<alpine-version>` \- Alpine version path, for example `v3.19` or `edge`

- `<channel>` \- Alpine repository channel, for example `main` or `community`

For example:

```
https://example.nexus.com/repository/alpine-group/v3.19/main
```

## Add the Repository URL to Alpine

Add the Nexus Alpine repository URL to `/etc/apk/repositories`.

```
echo "https://<nexus-host>/repository/<repository-name>/<alpine-version>/<channel>" >> /etc/apk/repositories
```

Where,

- `<nexus-host>` \- Host name and port for your Nexus Repository instance

- `<repository-name>` \- Name of the target Alpine repository in Nexus

- `<alpine-version>` \- Alpine version path

- `<channel>` \- Alpine repository channel

For example:

```
echo "https://example.nexus.com/repository/alpine-group/v3.19/main" >> /etc/apk/repositories
```

## Add The Public Key

If your Alpine repository uses signed metadata, add the public key generated during repository setup to the Alpine trusted keys directory at `/etc/apk/keys/`. Update the package index after adding the public key.

If you do not add the public key, you can use `--allow-untrusted` when installing a package. Sonatype does not recommend this option because it bypasses Alpine package signature trust checks.
