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.

How-to guideAdvanced2 min readUpdated

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

1. Create the repository in DirectAdmin

Open Advanced Features then 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, free for the first 30 days.

Popular

Tip: press / to search from any pageSee all results