Skip to content

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.


The primary command to start any Graft project.

How to use:

  1. Open your terminal and navigate to your project root directory (the folder containing your source code and docker-compose.yml).
  2. Run the initialization command:
Terminal window
graft init

The Workflow:

  1. Server Connection: Select an existing server from your registry or add a new one (/new).
  2. 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.
  3. Project Identity: Define your project name and primary domain name.
  4. Rollback Settings: Configure version retention (for instant rollbacks).
  5. Deployment Strategy: Choose your preferred Deployment Mode.
  6. Environment Sync: Graft sets up the remote directories and prepares the initial environment.

Watch the complete initialization process in action:

bash — project-root

Manually trigger the setup of Graft’s core infrastructure on a remote server.

Terminal window
graft host init

When 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-public bridge network.
  • Reverse Proxy: Professional Traefik configuration with automated SSL (Let’s Encrypt).
  • Shared Services: Guided setup for shared Postgres/Redis instances.