> For the complete documentation index, see [llms.txt](https://localxpose.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://localxpose.gitbook.io/docs/tutorials/access-localhost-keepass.md).

# Sync your Keepass password manager

This tutorial assumes you have already installed LocalXpose & logged in (see [getting started ](https://docs.localxpose.io/)& [cli](https://docs.localxpose.io/cli) ), also you have installed and setup openssh-server.&#x20;

## 1. Reserve an endpoint with custom port

> The command below will reserve an endpoint with custom port 2222 and region set to Asia Pacific.

```bash
$ loclx endpoint reserve --port 2222 --region ap
```

{% hint style="warning" %}
If port '2222' is already reserved, you can use any other port.
{% endhint %}

## 2. Create a Systemd Unit file

To keep LocalXpose running in background during boot we create a localxposessh.service unit file.

```bash
sudo nano /etc/systemd/system/localxposessh.service
```

and paste the following and save the file.

```bash
[Unit]
Description=LocalXpose Service to expose SSH port
After=network-online.target ssh.service

[Service]
ExecStart=/home/pi/loclx tunnel tcp --reserved-endpoint ap-1.loclx.io:2222 --to 22
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target
```

{% hint style="warning" %}
Make sure to replace 'ap-1.loclx.io:2222' with your reserved endpoint.&#x20;
{% endhint %}

## 3. Reload systemd daemon & enable service to start on boot.

```bash
sudo systemctl daemon-reload && sudo systemctl enable localxposessh.service
```

## 4. Start SSH service & LocalXpose password service

```bash
sudo systemctl start ssh.service && sudo systemctl start localxposessh.service
```

## 5. Add CNAME record for your custom domain (Optional)

> If you want to use custom domain name as endpoint, you will need to add a CNAME record similar to following screenshot.

![](/files/-M6nNGBYPcisAs7GBjnR)

## 6. Time to use KeePass

{% hint style="danger" %}
In this tutorial we used keepass2 v2.4 with plugin SftpSync enabled.
{% endhint %}

Open KeePass. Click on File > Open > Open URL.

![](/files/-M6nPr1YwFPrgeM6nZRJ)

Enter your URL along with path to your keepass database file. Also, provide your ssh authentication.

![](/files/-M6nSwcZwI4NNVjK-vFX)

{% hint style="info" %}
sftp: protocol (FTP over SSH)

password.xtestgo.xyz:2222 = Our custom domain name & Port ( use endpoint if you don't have domain)

/home/pi/.keepass/my\_pass.kdbx = Absolute path to our keepass database file.

User name & Password =  Your ssh credentials ( not keepass master password )
{% endhint %}

Once your database opens, enter your master key.

![](/files/-M6nUo4wDHHiD8pDm3FX)

There you have it,&#x20;

![](/files/-M6nWOc1ZF4V77G3Ijyn)

## 7. Open, Edit, Save.

You can now Edit & Save your keepass database. Your changes will be saved to your remote machine.&#x20;

You can open the same URL in any keepass compatible application including one avaliable for [Windows](https://keepass.info/download.html), [Android ](https://play.google.com/store/apps/details?id=keepass2android.keepass2android\&hl=en_US)& [macOS](https://macpassapp.org/).
