Deploying a website with Git

Clone a repository into your account with DirectAdmin’s Git feature and pull updates to deploy, keeping secrets and build artefacts out of the repo.

Guide2 min readLast updated
On this page
  1. 1. Create the repository in DirectAdmin
  2. 2. Clone outside public_html
  3. 3. Deploy updates
  4. Keep out of the repository
  5. If .git must sit inside public_html
  6. Common questions

DirectAdmin’s Git feature clones a repository into your account and pulls updates on demand.

1. Create the repository in DirectAdmin

Open Advanced Features › Git, create a repository, and enter the clone URL. For private repositories, add the deploy key DirectAdmin generates to your Git host as a read-only deploy key.

2. Clone outside public_html

Clone to a folder such as ~/apps/mysite, then publish only the public files, so .git and configuration are never web-accessible. Deploying a PHP application (Composer, Laravel and frameworks)

3. Deploy updates

Use the pull or deploy action after pushing changes.

Keep out of the repository

If .git must sit inside public_html

Block it:

RedirectMatch 404 /\.git

New to Traxio? The PHP hosting page lists the PHP versions, database and tools every account gets.

Common questions

Can I use Git on Traxio?

Yes. Git is available, and over SSH on port 26628 you can clone and pull a repository straight into your account, which is a much tidier deployment route than uploading files by hand.

Keep the repository’s working copy outside public_html where you can, and serve only the built output. That way nothing in .git is ever reachable from the web.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going