📡 Oxen Server
oxen-server
is the storage backend for Oxen. It is where the merkle tree, commit history, and other metadata is stored.
You can deploy your own oxen-server
instance on your own infrastructure, or use the hosted version on OxenHub. If you want to kick the tires of Oxen in the privacy of your own infrastructure, we recommend you setup a local server.
The hosted solution comes with a UI and the benefits of not having to setup infrastructure yourself. Sign up here to get started.
⚙️ Install
To setup a local Oxen Server instance, first install the oxen-server
binary.
Mac OS
On Mac-OS you can use Homebrew to install the binary.
Ubuntu
On Ubuntu you can download the latest .deb file from our GitHub Releases and install it.
Docker
To run the server in a docker container, download the latest .tar file from our GitHub Releases and run the following commands.
To install on other platforms, follow the installation instructions.
🏎️ Start Server
The server can be run with access token authentication turned on or off. The server runs with no authentication by default.
To enable authentication, generate a token to give it to the user to access to the server
You may have different authentication tokens for different hosts. From the client side, you can setup an auth token per host with the config
command. If you ever need to debug or edit the tokens manually, they are stored in the ~/.config/oxen/auth_config.toml
file.
To run the server with authentication, use the -a
flag
🗂️ Sync Directory
The default directory that Oxen stores data is /tmp/oxen_sync
, which is not a good idea for production. To change it set the SYNC_DIR
environment variable to a path.
If you want to change the default IP ADDRESS
and PORT
you can do so by passing them in with the -i
and -p
parameters.
📁 Create a Repository
Assuming you have already installed the oxen
CLI, you can create a remote repository on the server.
Note: The host and scheme are optional and default to hub.oxen.ai
and https
respectively. If you are running a local server, you can set the host to localhost:3000
and the scheme to http
.
You can either clone data from this remote repository, or push data to it.
🗄️ File Storage
When you create a remote repository, Oxen will create a directory for it on the server. The directory structure is $SYNC_DIR/<namespace>/<repo_name>/.oxen
.
All of the metadata and versioned files for a repository are stored in the .oxen
directory. This directory mirrors the .oxen
directory in your local repository, so that logic can be reused between the client and server.
TODO: We are working on adding support for other storage backends, like S3 and MinIO. If you would like to contribute, please see the Oxen-AI/Oxen repo on GitHub.
⬆️ Upload Data
To upload data to the server, you can use the oxen
CLI to initialize a local repository, add data to it, and push it to the server.
If you look in your local repository, you will see the .oxen
directory.
You can set the remote to the server by running the following command. This will update the config.toml
file in your local repository.
If you look at the config.toml
file, you will see the remote set.
Once a remote is set you can push your changes to the server.
You can change the remote (origin) and the branch (main) to whichever remote and branch you want to push.
⬇️ Clone Data
Clone the empty repository:
API Spec
The server has a REST API that can be used to interact with the server. The API is documented here.