This guide covers deploying ContainerYard in various environments, from local development to production deployments.
- Local Development
- Building for Production
- Deployment Options
- Remote Agent Setup
- Docker Containerization
- Environment Configuration
- Node.js 18+ and npm
- (Optional) Docker daemon for REMOTE provider
- (Optional) PostgreSQL for saved searches
# Clone and install
git clone git@github.com:hexawulf/ContainerYard.git
cd ContainerYard
npm install
# Configure environment
cp .env.example .env
# Start development server
npm run devAccess at: http://localhost:3000 (or configured PORT)
Set PROVIDER=MOCK in .env - no Docker needed!
PROVIDER=MOCK
PORT=3000
NODE_ENV=development# Install dependencies
npm install
# Build frontend and backend
npm run buildThis creates optimized production files in dist/.
Create a production .env:
NODE_ENV=production
PORT=3000
PROVIDER=REMOTE
DOCKER_HOST=http://your-docker-host:2375
DOCKER_AUTH_TOKEN=your-secure-token
ALLOWED_ORIGINS=https://yourdomain.com
DATABASE_URL=postgresql://user:pass@host:5432/containeryard
SESSION_SECRET=your-secure-random-stringVercel is ideal for the frontend, but requires a separate backend deployment.
- Deploy Frontend:
npm install -g vercel
vercel- Configure Environment Variables in Vercel dashboard:
VITE_API_URL=https://your-backend-url.com
- Deploy Backend Separately (see Railway or self-hosted)
Railway supports full-stack Node.js applications perfectly.
- Install Railway CLI:
npm install -g @railway/cli
railway login- Initialize and Deploy:
railway init
railway up- Set Environment Variables in Railway dashboard:
NODE_ENV=production
PROVIDER=REMOTE
DOCKER_HOST=http://your-docker-host:2375
DOCKER_AUTH_TOKEN=your-token
ALLOWED_ORIGINS=https://your-railway-app.railway.app
DATABASE_URL=postgresql://...
SESSION_SECRET=random-secret
- Configure Domain in Railway dashboard
Similar to Vercel - frontend only, requires separate backend.
- Deploy:
npm install -g netlify-cli
netlify deploy --prod-
Configure build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
-
Set environment variables in Netlify dashboard
Perfect for running on your own server, VPS, or homelab.
# Install PM2 globally
npm install -g pm2
# Build the application
npm run build
# Start with PM2
pm2 start server/index.js --name containeryard
# Enable startup script
pm2 startup
pm2 saveCreate /etc/systemd/system/containeryard.service:
[Unit]
Description=ContainerYard Docker Dashboard
After=network.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/ContainerYard
Environment=NODE_ENV=production
ExecStart=/usr/bin/node server/index.js
Restart=always
[Install]
WantedBy=multi-user.targetsudo systemctl enable containeryard
sudo systemctl start containeryardserver {
listen 80;
server_name containeryard.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# WebSocket support
location /ws {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}For monitoring Docker containers on remote hosts (NAS, Raspberry Pi, servers).
- Enable Docker API on target host
- Configure CORS for security
- Set authentication token (recommended)
- SSH into your Synology NAS:
ssh admin@your-nas-ip- Edit Docker daemon config:
sudo vi /var/packages/Docker/etc/dockerd.json- Add hosts configuration:
{
"data-root": "/volume1/@docker",
"hosts": [
"unix:///var/run/docker.sock",
"tcp://0.0.0.0:2375"
]
}- Restart Docker:
sudo synoservicectl --restart pkgctl-DockerAdd firewall rule to allow port 2375 from your ContainerYard host only.
PROVIDER=REMOTE
DOCKER_HOST=http://your-nas-ip:2375
ALLOWED_ORIGINS=https://your-containeryard-domain.comcurl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.shEdit /etc/docker/daemon.json:
{
"hosts": [
"unix:///var/run/docker.sock",
"tcp://0.0.0.0:2375"
]
}Override systemd service:
sudo mkdir -p /etc/systemd/system/docker.service.dCreate /etc/systemd/system/docker.service.d/override.conf:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerdRestart Docker:
sudo systemctl daemon-reload
sudo systemctl restart dockerGenerate TLS certificates for secure communication:
# Generate CA and certificates
openssl genrsa -out ca-key.pem 4096
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pemConfigure Docker for TLS and set DOCKER_AUTH_TOKEN environment variable.
- Use TLS encryption for Docker API
- Set authentication tokens via
DOCKER_AUTH_TOKEN - Restrict ALLOWED_ORIGINS to your dashboard domain only
- Use firewall rules to limit access to port 2375
- Consider VPN for accessing remote Docker hosts
- Regular security updates on all hosts
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/server ./server
RUN npm ci --production
EXPOSE 3000
CMD ["node", "server/index.js"]version: '3.8'
services:
containeryard:
build: .
ports:
- "3000:3000"
environment:
- PROVIDER=REMOTE
- DOCKER_HOST=http://host.docker.internal:2375
volumes:
- /var/run/docker.sock:/var/run/docker.sock| Variable | Description | Default | Required |
|---|---|---|---|
PORT |
Server port | 3000 |
No |
NODE_ENV |
Environment | development |
No |
PROVIDER |
Data source | MOCK |
Yes |
| Variable | Description | Required |
|---|---|---|
DOCKER_HOST |
Docker API endpoint | Yes |
DOCKER_AUTH_TOKEN |
Bearer token | No |
ALLOWED_ORIGINS |
CORS origins | Yes |
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection | For saved searches |
SESSION_SECRET |
Session encryption key | For sessions |
PROVIDER=MOCK
PORT=3000PROVIDER=SIMULATION
PORT=3000PROVIDER=REMOTE
DOCKER_HOST=http://docker-host:2375
DOCKER_AUTH_TOKEN=secret-token
ALLOWED_ORIGINS=https://containeryard.yourdomain.com
DATABASE_URL=postgresql://user:pass@db:5432/containeryard
SESSION_SECRET=random-secret-keyContainerYard exposes health endpoints:
GET /api/health- Application healthGET /api/containers- Container list (verifies provider)
# PM2 logs
pm2 logs containeryard
# Systemd logs
journalctl -u containeryard -f
# Docker logs (if containerized)
docker logs -f containeryard- Enable PostgreSQL for persistent saved searches
- Configure log retention in provider settings
- Use WebSocket compression for log streaming
- Implement rate limiting for API endpoints
Cannot connect to Docker API:
- Verify Docker daemon is running
- Check Docker API is enabled on port 2375
- Ensure firewall allows connection
- Verify
DOCKER_HOSTURL is correct
CORS errors:
- Add your domain to
ALLOWED_ORIGINS - Include protocol (http:// or https://)
- Check for trailing slashes
WebSocket connection fails:
- Ensure reverse proxy supports WebSocket upgrades
- Check
UpgradeandConnectionheaders - Verify firewall allows WebSocket connections
For issues and questions:
- GitHub Issues: https://github.com/hexawulf/ContainerYard/issues
- Documentation: https://github.com/hexawulf/ContainerYard
Made with ❤️ by hexawulf