Skip to main content

PC2 Configuration

All PC2 configuration options and environment variables.

Configuration File

Location: data/config/pc2.json

{
"pc2_mode": true,
"http_port": 4200,
"accessControl": {
"enabled": false,
"allowedWallets": []
},
"boson": {
"enabled": true,
"superNodes": [...]
},
"ai": {
"defaultProvider": "ollama",
"ollama": {
"baseUrl": "http://localhost:11434"
}
},
"updates": {
"autoCheck": true,
"checkInterval": 21600000
}
}

Core Settings

KeyTypeDefaultDescription
pc2_modebooleantrueEnable PC2 features (vs vanilla Puter)
http_portnumber4200HTTP server port
data_dirstring"./data"Data storage directory

Access Control

{
"accessControl": {
"enabled": false,
"allowedWallets": [
{
"wallet": "0x1234...",
"role": "admin",
"addedAt": "2024-01-15T10:00:00Z"
}
]
}
}
KeyTypeDescription
enabledbooleanEnable access control
allowedWalletsarrayList of allowed wallet entries
allowedWallets[].walletstringEthereum address (0x...)
allowedWallets[].rolestring"owner", "admin", or "member"
allowedWallets[].addedAtstringISO timestamp when added

Boson Network

{
"boson": {
"enabled": true,
"superNodes": [
{
"host": "198.51.100.1",
"dhtPort": 39001,
"proxyPort": 8090
}
],
"proxy": {
"enabled": true,
"keepaliveInterval": 30000,
"reconnectDelay": 5000
}
}
}
KeyTypeDefaultDescription
enabledbooleantrueEnable Boson integration
superNodesarray[...]List of super node endpoints
proxy.enabledbooleantrueEnable Active Proxy
proxy.keepaliveIntervalnumber30000PING interval (ms)
proxy.reconnectDelaynumber5000Reconnect delay (ms)

AI Providers

{
"ai": {
"defaultProvider": "ollama",
"ollama": {
"baseUrl": "http://localhost:11434",
"defaultModel": "deepseek-r1:7b"
},
"openai": {
"apiKey": "sk-...",
"defaultModel": "gpt-4o"
},
"anthropic": {
"apiKey": "sk-ant-...",
"defaultModel": "claude-3-opus-20240229"
},
"gemini": {
"apiKey": "AIza...",
"defaultModel": "gemini-2.0-flash"
},
"xai": {
"apiKey": "xai-...",
"defaultModel": "grok-3"
}
}
}
KeyTypeDescription
defaultProviderstringDefault AI provider
[provider].apiKeystringAPI key for provider
[provider].baseUrlstringCustom API endpoint
[provider].defaultModelstringDefault model to use

Updates

KeyTypeDefaultDescription
autoCheckbooleantrueAuto-check for updates
checkIntervalnumber21600000Check interval (ms, 6 hours)
githubRepostring"Elacity/pc2.net"GitHub repo for updates

Session

KeyTypeDefaultDescription
expiryDaysnumber7Session duration in days
cookieNamestring"session"Cookie name for session

Storage

KeyTypeDefaultDescription
maxFileSizenumber104857600Max upload size (100MB)
ipfs.enabledbooleantrueEnable IPFS storage
ipfs.repostring"./data/ipfs"IPFS repo directory

Environment Variables

Override config with environment variables:

VariableDescription
PORTHTTP port (overrides http_port)
NODE_ENVEnvironment ("development" or "production")
PC2_DATA_DIRData directory path
PC2_CONFIG_FILEPath to config file
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
GEMINI_API_KEYGoogle AI API key
XAI_API_KEYxAI API key

Example Configurations

Minimal (Development)

{
"pc2_mode": true,
"http_port": 4200
}

Production (VPS)

{
"pc2_mode": true,
"http_port": 4200,
"accessControl": {
"enabled": true
},
"boson": {
"enabled": true
},
"updates": {
"autoCheck": true
}
}

Private (Home Server)

{
"pc2_mode": true,
"http_port": 4200,
"accessControl": {
"enabled": true,
"allowedWallets": [
{"wallet": "0xmywallet...", "role": "owner"}
]
},
"ai": {
"defaultProvider": "ollama",
"ollama": {
"baseUrl": "http://localhost:11434"
}
}
}

Config Validation

PC2 validates configuration on startup. Invalid config causes an error:

[ERROR] Configuration validation failed:
- accessControl.allowedWallets[0].wallet: Invalid Ethereum address

Fix the error and restart.