Ga naar inhoud

Kinsta Hosting

Overview

Kinsta is a hosting platform used for Lemone WordPress projects.


Changing Webroot

For deploying Bedrock/Trellis websites at Kinsta, the webroot needs to be adjusted. This can be done via support, but also through an API call.

Via Kinsta API

Use the Kinsta API to change the webroot subfolder:

curl -i -X POST \
  'https://api.kinsta.com/v2/sites/environments/XXX/change-webroot-subfolder' \
  -H 'Authorization: Bearer XXX' \
  -H 'Content-Type: application/json' \
  -d '{
    "web_root_subfolder": "/current/web",
    "clear_all_cache": true,
    "refresh_plugins_and_themes": true
  }'

Parameters: - web_root_subfolder: Path relative to the site root (e.g., /current/web for Bedrock) - clear_all_cache: Clear all Kinsta cache after changing webroot - refresh_plugins_and_themes: Refresh the plugins and themes list

Required values: - Replace XXX in the URL with your environment ID - Replace Bearer XXX with your Kinsta API token

Getting Your Environment ID

  1. Log in to MyKinsta
  2. Navigate to your site
  3. Go to Settings > Info
  4. Copy the Environment ID

Getting Your API Token

  1. Go to Kinsta Account Settings
  2. Create or copy an existing API key
  3. Store it securely (never commit to version control)

Via Kinsta Support

Alternatively, contact Kinsta support and request: - Set webroot to /current/web (for Bedrock/Trellis) - Enable symlink support (required for Trellis deployments)


Kinsta-specific Configuration

Trellis Deployment to Kinsta

When deploying Trellis-based projects to Kinsta:

  1. Set webroot to /current/web
  2. Enable symlinks (via support ticket)
  3. Configure SSH access in trellis/group_vars/production/wordpress_sites.yml:
wordpress_sites:
  example.com:
    site_hosts:
      - canonical: example.com
    local_path: ../site
    repo: git@codepot.nl:project/repository.git
    branch: main
    ssh:
      host: your-site.kinsta.cloud
      port: 12345  # Custom SSH port from Kinsta
      user: your-site
  1. Deploy:
    cd trellis
    ./bin/deploy.sh production example.com
    

SSH Access

Kinsta uses custom SSH ports for each site:

ssh -p PORT user@host.kinsta.cloud

Find your SSH details in MyKinsta under: Sites > Your Site > Info > SFTP/SSH

WP-CLI Usage

WP-CLI is pre-installed on Kinsta:

ssh -p PORT user@host.kinsta.cloud
cd public/current
wp --info

Troubleshooting

Determine high disk usage for sites

  1. First check in MyKinsta which sites have the most disk usage

  2. Sign in with SSH and run these commands.

Check disk usage and sort by largest folder:

du -hs * | sort -rh | head -10

Check file usage:

find -type f -exec du -Sh {} + | sort -rh | head -n 10


Resources


See Also