# Where Is the OpenLogi Configuration File Located? A Complete Cross-Platform Guide

> Find the OpenLogi configuration file location easily with our complete cross-platform guide. Learn paths for macOS, Linux, and Windows to quickly access your settings.

- Repository: [Xuan Zhang/OpenLogi](https://github.com/AprilNEA/OpenLogi)
- Tags: how-to-guide
- Published: 2026-08-21

---

**The OpenLogi configuration file is stored at `$XDG_CONFIG_HOME/openlogi/config.toml` on macOS and Linux (defaulting to `~/.config/openlogi/config.toml`), and at `%USERPROFILE%\.config\openlogi\config.toml` on Windows.**

OpenLogi is an open-source logistics management platform developed by AprilNEA that stores its settings in a plain TOML file accessible by both the GUI and the background agent. Understanding the exact OpenLogi configuration file location is essential for manual edits, backups, and automation scripts.

## Default Configuration File Paths by Platform

The AprilNEA/OpenLogi repository follows standard operating system conventions for configuration storage. As documented in [`docs/CONFIGURATION.md`](https://github.com/AprilNEA/OpenLogi/blob/main/docs/CONFIGURATION.md) (lines 5-8), the application uses the XDG Base Directory Specification on Unix-like systems and the Windows user profile convention on Microsoft platforms.

### macOS and Linux (XDG Base Directory)

On macOS and Linux systems, OpenLogi adheres to the XDG Base Directory Specification. The configuration file resides at:

```bash
$XDG_CONFIG_HOME/openlogi/config.toml

```

If the `XDG_CONFIG_HOME` environment variable is not set, the application defaults to:

```bash
~/.config/openlogi/config.toml

```

### Windows (User Profile Directory)

On Windows, OpenLogi stores the configuration within the user's home directory under a `.config` folder:

```powershell
%USERPROFILE%\.config\openlogi\config.toml

```

This typically resolves to `C:\Users\<Username>\.config\openlogi\config.toml`.

## How OpenLogi Resolves the Configuration Path

According to the source code in [`crates/openlogi-core/src/config.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-core/src/config.rs), the application programmatically determines the configuration path using the `dirs::config_dir()` library. The internal `config_path()` function constructs the full path by appending the `openlogi` directory and [`config.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/config.toml) filename to the system's configuration directory:

```rust
// openlogi-core/src/config.rs (simplified)
use std::path::PathBuf;
use dirs::config_dir;

/// Returns the full path to OpenLogi's config file for the current platform.
fn config_path() -> PathBuf {
    let mut base = config_dir().expect("Unable to locate config directory");
    base.push("openlogi");
    base.push("config.toml");
    base
}

```

Both the GUI application and the background agent ([`crates/openlogi-agent/src/main.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/crates/openlogi-agent/src/main.rs)) invoke this same core logic to ensure they read from identical locations.

## Working with the Configuration File

### Creating Your Initial Configuration

New users should reference [`docs/config.example.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/docs/config.example.toml) in the repository root. This fully-populated example demonstrates all available configuration options, including physical-device keys that must be edited after the first run. Copy the relevant sections from this example into your active configuration file at the platform-specific path listed above.

### Atomic Writes and Backup Management

When the OpenLogi GUI saves configuration changes, it performs atomic writes to prevent corruption. The system automatically maintains up to five backup copies named sequentially:

- `config.toml.backup.1`
- `config.toml.backup.2`
- `config.toml.backup.3`
- `config.toml.backup.4`
- `config.toml.backup.5`

If you edit the configuration file externally using a text editor or script, the GUI detects this on its next save attempt and rejects the operation to prevent overwriting your external changes. This synchronization mechanism ensures the agent and GUI maintain consistent state.

## Code Examples for Locating the File

You can programmatically locate the configuration file in your own scripts or applications using these platform-aware snippets.

### Bash Script (Linux/macOS)

```bash
#!/usr/bin/env bash

# Show the current OpenLogi config

CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/openlogi/config.toml"
if [[ -f "$CONFIG" ]]; then
    cat "$CONFIG"
else
    echo "Config file not found at $CONFIG"
fi

```

### PowerShell (Windows)

```powershell

# Display OpenLogi configuration content

$configPath = Join-Path $env:USERPROFILE ".config\openlogi\config.toml"
if (Test-Path $configPath) {
    Get-Content $configPath
} else {
    Write-Host "Config file not found at $configPath"
}

```

## Summary

- OpenLogi uses a single **TOML configuration file** shared between the GUI and agent components.
- On **macOS and Linux**, the file is located at `$XDG_CONFIG_HOME/openlogi/config.toml` (defaulting to `~/.config/openlogi/config.toml`).
- On **Windows**, the file is stored at `%USERPROFILE%\.config\openlogi\config.toml`.
- The path resolution logic is implemented in [`openlogi-core/src/config.rs`](https://github.com/AprilNEA/OpenLogi/blob/main/openlogi-core/src/config.rs) using the `dirs` crate.
- The GUI maintains up to **five backup copies** and performs **atomic writes** to prevent data loss.
- Reference [`docs/config.example.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/docs/config.example.toml) for the complete list of available configuration options.

## Frequently Asked Questions

### What format does the OpenLogi configuration file use?

The OpenLogi configuration file uses the **TOML** (Tom's Obvious, Minimal Language) format. This plaintext format is human-readable and allows for clear sectioning of settings, making it easy to edit device keys and connection parameters manually.

### Can I edit the configuration file while OpenLogi is running?

Yes, but with caution. The OpenLogi GUI detects external modifications and will reject its next save attempt to prevent overwriting your changes. The background agent typically reads the configuration at startup, so changes made while the agent is running may require a restart to take effect.

### Where can I find an example configuration file?

The repository includes a comprehensive example at [`docs/config.example.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/docs/config.example.toml). This file contains all possible configuration options with explanatory comments. You should copy sections from this example into your active configuration file after installation, particularly the physical-device keys that are generated during the first run.

### How do I back up my OpenLogi configuration?

You can back up the [`config.toml`](https://github.com/AprilNEA/OpenLogi/blob/main/config.toml) file directly from the platform-specific location. Additionally, OpenLogi automatically creates up to five rolling backups (`config.toml.backup.1` through `config.toml.backup.5`) in the same directory whenever the GUI performs a save operation, providing built-in recovery options for recent configuration states.