Instance Environment Variables
You can set custom environment variables that will be available to Minecraft and any mods during runtime.Configuration
Global Environment Variables
Set variables that apply to all instances:- Navigate to Settings → Minecraft → Environment Variables
- Add variable name-value pairs
- Click OK to save
Per-Instance Environment Variables
Override global variables for specific instances:- Right-click an instance → Edit Instance → Settings
- Navigate to Environment Variables
- Check Override Global Settings
- Add or modify variables
- Click OK to save
Common Use Cases
Launcher-Provided Variables
These variables are automatically set by Prism Launcher and available to custom commands:The display name of the instance
The unique identifier of the instance (folder name)
Absolute path to the instance root directory
Absolute path to the Minecraft game directory (usually
instance_dir/minecraft or instance_dir/.minecraft)Path to the Java executable used for this instance
The JVM arguments used for launch
System-Wide Launcher Variables
These environment variables affect the launcher itself and must be set before starting Prism Launcher.Data Directory
Override the default data directory location
Linux/macOS
Windows (PowerShell)
This is equivalent to using the
--dir command-line argument. The command-line argument takes precedence if both are specified.Qt Logging
Control which Qt logging categories are shown in the launcher logsMultiple categories can be separated by semicolons (
Enable specific categories
;). See Qt Logging Categories for details.Customize the format of console output messagesSee Qt Message Pattern for available placeholders.
Custom format
Linux-Specific Variables
Preload shared libraries before running Minecraft (Linux only)
Example with custom library
Automatically set when running from AppImage. Points to the AppImage file path.
Used internally by the launcher for updates and creating shortcuts.
Performance-Related Variables
These environment variables can improve Minecraft performance:Mesa Drivers (Linux)
Zink can be enabled directly in instance settings under Performance → Use Zink. When enabled via settings, these variables are set automatically.
Memory Management
GPU Selection
GPU selection can be enabled in instance settings under Performance → Use Discrete GPU. When enabled, these variables are configured automatically on Linux.
Graphics and Rendering
LWJGL Variables
Input Method (Linux)
Java-Specific Variables
Override the Java installation path
Linux/macOS
Additional JVM options applied to all Java processes
Example
These options are applied in addition to those configured in instance settings.
Storage Format
Environment variables are stored as JSON in the launcher configuration:settings.json
instance.cfg:
instance.cfg
Variable Precedence
- System environment - Variables set in your shell or system
- Launcher-provided - Variables like
INST_NAME,INST_DIR - Global custom variables - Set in launcher global settings
- Instance custom variables - Set in per-instance settings (highest priority)
- Feature-specific - Variables set by launcher features (MangoHud, Gamemode, etc.)
Troubleshooting
Variables Not Applied
- Restart the launcher after setting system-wide variables
- Verify variables are saved in settings (check
settings.jsonorinstance.cfg) - Check for typos in variable names
- Ensure override is enabled for instance-specific variables
Syntax Errors
Conflicts
If launcher features (like GPU switching) conflict with manual variables:- Disable the launcher feature
- Set variables manually
- Or use the launcher feature and let it manage the variables
Security Considerations
Related Documentation
- Custom Commands - Use environment variables in pre/post-launch commands
- Command-Line Arguments - Control launcher behavior from command line
- Portable Mode - Portable data directory configuration
