Your Appwrite self-hosted platform uses the Docker network to isolate your container from the outside world.
As that, we first need to obtain the MariaDB internal IP. To find it run the following command on your server
$: docker network inspect appwrite_appwrite --format '{{range .Containers}}{{println .Name .IPv4Address println }}{{end}}' | grep mariadb
docker network inspect appwrite_appwrite --format "{{range .Containers}}{{println .Name .IPv4Address println }}{{end}}" | findstr /c:"maria"
You will get something like that:
appwrite-mariadb 172.21.0.2/16
So, in this case the MariaDB internal IP is 172.21.0.2
.
Download any one of the following Database management tools
- 🆓 HeidiSQL - Windows only
- 🆓 TablePlus
- 🆓 Beekeepr Studio
- 💵 Datagrip
As the MariaDB container is not accessible from the outside world, you'll need to create a tunnel between the database management tool and your MariaDB container.
graph LR
subgraph H[Your local computer]
A[SSH Key]
B[Database Management tool]
A-.->B
end
subgraph R[Your Appwrite server]
D[Local User] --> G[MariaDB Container]
end
H <-..SSH tunnel..-> R
To create this tunnel you'll need
- Appwrite server IP.
- SSH key.
- MariaDB internal IP
- MariaDB username and password.
- The username and password are located in the
.env
file. This file is usually located in/root/appwrite/.env
file. If you've installed Appwrite in some manual way, then the.env
file will be in the same folder as yourdocker-compose.yml
file.
From that file, grab the following values for the MariaDB.
_APP_DB_USER=user
_APP_DB_PASS=password
Now you can set your SSH tunneling for any of your chosen management tools.
Below you'll have example how to do it in selected tools For the sake of the examples we'll assume the following details:
Field | Value |
---|---|
Appwrite Server | 127.0.0.1 |
Appwrite Server Username | root |
Appwrite Server Password | toor |
MariaDB Internal IP | 172.19.0.6 |
MariaDB user | user |
MariaDB database | appwrite |
MariaDB password | secret |