-
Notifications
You must be signed in to change notification settings - Fork 0
Self Hosting
If you're running into limits with the free version, or you know your project gets lots of traffic so you're planning ahead, it is always best to host your own infrastructure.
We publish a Docker container which runs the API using GitHub packages which you can find at https://github.com/ohonesix/api.universalnft.dev/pkgs/container/universalnftdev
The API is built with .NET 8, so you can build and publish it to run directly in any operating system if you wish. However, for this guide we will be using Docker as that's how we run our public infra.
For this example we're using Debian, but almost any modern distro / OS should work.
- Make sure you have Docker installed and working (we won't cover this, many tutorials available online)
- Create a new directory for your project and its
.envfile somewhere on your server - Look at the default values and determine what needs to change for your environment
- Create a
.envfile with your changes, for example to configure a custom Rippled server and API Server External Domain you would havesudo nano .env
XRPLSettings__XRPLServerAddress=http://rippled.example.com:4006/
ServerSettings__ServerExternalDomain=https://mysiteapi.example.com
- Pull the image
sudo docker pull ghcr.io/ohonesix/universalnftdev:latest
If you see an error relating to the platform, try specify it with using this command instead
sudo docker pull --platform linux/amd64 ghcr.io/ohonesix/universalnftdev:latest
- Run the container
sudo docker run --env-file .env -d -p 5103:5103 --name universalnftdevapi ghcr.io/ohonesix/universalnftdev:latest - Go to your http://localhost:5103 or whichever port you decided to run it on
- If you want to expose it publicly you may prefer to put it behind a reverse proxy like Nginx, but again, many guides for that available just route traffic to your service port and you should be good to go.
If a new version is available and you're not using something like Portainer to automatically update, you can follow these quick steps
- Stop the running container
sudo docker stop universalnftdevapi - Delete the existing container
sudo docker container rm universalnftdevapi - Go back to where you created the
.envfile the first time, e.g.cd universalnftdev/ - Pull the image again
sudo docker pull ghcr.io/ohonesix/universalnftdev:latest - Start it again
sudo docker run --env-file .env -d -p 5103:5103 --name universalnftdevapi ghcr.io/ohonesix/universalnftdev:latest