Initialization
To begin using Graft, you need to initialize your project. In most cases, a single command is all you need to set up both your project context and your remote server.
graft init
Section titled “graft init”The primary command to start any Graft project.
How to use:
- Open your terminal and navigate to your project root directory (the folder containing your source code and
docker-compose.yml). - Run the initialization command:
graft initThe Workflow:
- Server Connection: Select an existing server from your registry or add a new one (
/new). - Host Audit: Graft checks if the target server has the required infrastructure (
/opt/graft).- Auto-Detection: If the host is not initialized, Graft will automatically prompt you to run the host initialization process.
- Project Identity: Define your project name and primary domain name.
- Rollback Settings: Configure version retention (for instant rollbacks).
- Deployment Strategy: Choose your preferred Deployment Mode.
- Environment Sync: Graft sets up the remote directories and prepares the initial environment.
Live Demo (Interactive Session)
Section titled “Live Demo (Interactive Session)”Watch the complete initialization process in action:
bash — project-root
graft host init
Section titled “graft host init”Manually trigger the setup of Graft’s core infrastructure on a remote server.
graft host initWhen to use this?
While graft init is the primary command and is usually enough for most workflows (as it auto-detects host status), you might use graft host init if:
- You want to prepare a server before you have a specific project ready.
- You need to re-initialize or repair the core infrastructure on an existing host.
- You want to manually trigger the installation of shared services (Postgres, Redis) independently.
Infrastructure includes:
- Docker & Docker Compose: Automated installation for major Linux distributions.
- Networking: Setup of the
graft-publicbridge network. - Reverse Proxy: Professional Traefik configuration with automated SSL (Let’s Encrypt).
- Shared Services: Guided setup for shared Postgres/Redis instances.