Where is the Snipe-IT Configuration File Located?

The Snipe-IT configuration files are located in the config/ directory at the repository root, with sensitive credentials loaded from the .env file in the project root.

Snipe-IT is built on the Laravel framework, so it follows Laravel's convention of storing runtime configuration in dedicated PHP files within the config/ directory. Each component—from database connections to session handling—has its own file, while secret values like passwords and API keys are kept separate in the environment file.

Primary Configuration Directory Structure

The config/ directory contains individual PHP files that define settings for every major subsystem. These files return arrays that Laravel loads at boot time and merges with variables from .env.

Core Application Settings

The main application configuration lives in config/app.php. This file defines the application name, locale, timezone, and service providers. For example, the timezone setting can be retrieved via Config::get('app.timezone').

Database Connections

config/database.php defines connection details for MySQL, SQLite, PostgreSQL, and other supported databases. The file uses env('DB_HOST'), env('DB_DATABASE'), and env('DB_PASSWORD') to pull actual credentials from the .env file, ensuring passwords never enter version control.

Session and Authentication

Session handling is configured in config/session.php, which sets the cookie name to snipeitv6_session by default and defines the session lifetime. For API authentication via Laravel Passport, config/passport.php specifies the token cookie name as snipeit_passport_token along with other Passport-specific settings.

Mail and File Storage

Email service settings reside in config/mail.php, including SMTP host, port, and the global "from" address. File upload destinations are defined in config/filesystems.php, which configures disks for local storage, Amazon S3, or other cloud providers.

Specialized Features

Snipe-IT includes additional configuration for specific packages:

  • config/dompdf.php: Controls PDF generation options and chroot paths for assets
  • config/backup.php: Configures the Laravel backup package, including the filename prefix snipe-it-

Environment Configuration (.env File)

The .env file sits in the repository root (excluded from Git for security) and holds environment-specific secrets. Configuration files reference these values using the env() helper function:

$dbPassword = env('DB_PASSWORD');
$mailHost = env('MAIL_HOST', 'smtp.mailgun.org'); // With default fallback

Changes to .env require clearing the configuration cache (php artisan config:cache) to take effect in production environments.

Accessing Configuration Values in Code

In controllers, models, or service classes, use the Config facade to read or modify settings:

Reading configuration values:

use Illuminate\Support\Facades\Config;

$appName = Config::get('app.name');
$sessionLifetime = Config::get('session.lifetime');
$cookieName = Config::get('session.cookie'); // Returns 'snipeitv6_session'

Overriding values at runtime:

Config::set('app.timezone', 'America/New_York');
Config::set('mail.from.address', 'noreply@example.com');

Accessing environment variables directly:

use Illuminate\Support\Facades\Env;

$backupPrefix = Env::get('BACKUP_PREFIX', 'snipe-it-');

Summary

  • The Snipe-IT configuration files are located in the config/ directory, with one PHP file per component (app, database, mail, session, etc.).
  • Sensitive credentials belong in the .env file at the project root, never in the committed configuration files.
  • config/app.php controls core Laravel settings, while config/database.php, config/mail.php, and config/session.php manage their respective subsystems.
  • Specialized files like config/passport.php (authentication), config/dompdf.php (PDFs), and config/backup.php handle package-specific settings.
  • Access configuration in code using Config::get() and Config::set(), or read the .env file directly via env().

Frequently Asked Questions

Where is the Snipe-IT configuration file located?

The primary configuration files are located in the config/ directory at the repository root. Each aspect of the application (database, mail, sessions) has its own dedicated file here, such as config/app.php for core settings and config/database.php for connection details.

What is the difference between config files and the .env file?

Configuration files in config/ contain structured PHP arrays with default values and logic, while the .env file contains environment-specific secrets like passwords and API keys. The config files reference .env variables using env('VARIABLE_NAME'), keeping sensitive data out of version control.

The session cookie name is defined in config/session.php and defaults to snipeitv6_session. You can modify this by changing the 'cookie' key in that file, or by setting the SESSION_COOKIE variable in your .env file, which the configuration reads via env('SESSION_COOKIE', 'snipeitv6_session').

Can I override configuration values at runtime?

Yes, use Config::set('file.key', 'value') to override settings programmatically within controllers or middleware. For example, Config::set('app.timezone', 'Europe/London') changes the timezone for the current request. Note that this does not persist between requests and does not modify the underlying files.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →