PHPackages                             cocomedia-nl/laravel-directadmin-deploy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. cocomedia-nl/laravel-directadmin-deploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

cocomedia-nl/laravel-directadmin-deploy
=======================================

Laravel package for automated DirectAdmin deployment with GitHub Actions support

0.1.8(2mo ago)0578MITPHPPHP ^8.2

Since Dec 1Pushed 2mo agoCompare

[ Source](https://github.com/cocomedia-nl/laravel-directadmin-deploy)[ Packagist](https://packagist.org/packages/cocomedia-nl/laravel-directadmin-deploy)[ RSS](/packages/cocomedia-nl-laravel-directadmin-deploy/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (18)Versions (9)Used By (0)

Laravel DirectAdmin Deploy
==========================

[](#laravel-directadmin-deploy)

Originally inspired by laravel-hostinger-deploy by TheCodeholic

Deploy your Laravel application to DirectAdmin shared hosting with automated GitHub Actions support.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require cocomedia-nl/laravel-directadmin-deploy:^0.1 --dev
```

Or install the latest version:

```
composer require cocomedia-nl/laravel-directadmin-deploy --dev
```

> **Note:** This package should be installed as a development dependency (`--dev`) since it's only needed during deployment, not in production.

Required Environment Variables
------------------------------

[](#required-environment-variables)

Before using any deployment commands, add these to your `.env` file:

```
DIRECTADMIN_SSH_HOST=your-server-ip
DIRECTADMIN_SSH_USERNAME=your-username
DIRECTADMIN_SSH_PORT=22
DIRECTADMIN_SITE_DIR=your-website-folder
GITHUB_API_TOKEN=your-github-token
```

### SSH Authentication Setup

[](#ssh-authentication-setup)

> **⚠️ Important:** It is **highly recommended** to set up SSH public key authentication on your DirectAdmin server instead of using password authentication. Public key authentication is more secure and eliminates the need to enter passwords during deployments.
>
> **To set up SSH public key authentication:**
>
> 1. Generate an SSH key pair on your local machine: `ssh-keygen -t rsa -b 4096`
> 2. Copy your public key to the server: `ssh-copy-id username@your-server-ip`
> 3. Test the connection: `ssh username@your-server-ip` (should connect without password prompt)
>
> Once configured, the deployment commands will use your SSH key automatically, making deployments seamless and secure.

Quick Start (All-in-One Command)
--------------------------------

[](#quick-start-all-in-one-command)

The easiest way to deploy and set up automated deployment:

```
php artisan directadmin:deploy-and-setup-cicd
```

**What this command does:**

1. Deploys your Laravel application to DirectAdmin
2. Sets up SSH keys on the server
3. Automatically adds deploy key to GitHub repository via API
4. Publishes GitHub Actions workflow file locally (`.github/workflows/directadmin-deploy.yml`)
5. Configures GitHub secrets and variables via API

**Command Options:**

- `--fresh` - Delete existing files and clone fresh repository
- `--site-dir=` - Override site directory from config
- `--token=` - GitHub Personal Access Token (overrides GITHUB\_API\_TOKEN from .env)
- `--branch=` - Branch to deploy (default: auto-detect)
- `--php-version=` - PHP version for workflow (default: 8.3)

Individual Commands
-------------------

[](#individual-commands)

### 1. Manual Deployment Only

[](#1-manual-deployment-only)

```
php artisan directadmin:deploy
```

**What it does:** Deploys your Laravel application to DirectAdmin server (composer install, migrations, storage link, etc.)

**Command Options:**

- `--fresh` - Delete existing files and clone fresh repository
- `--site-dir=` - Override site directory from config
- `--token=` - GitHub Personal Access Token (optional, enables automatic deploy key management)
- `--show-errors` - Display detailed error messages with exit codes and command output

> **Note:** If `GITHUB_API_TOKEN` is provided (via `.env` or `--token` option), the command will automatically add deploy keys to your GitHub repository. Otherwise, you'll be prompted to add the deploy key manually.

---

### 2. Create GitHub Actions Workflow File

[](#2-create-github-actions-workflow-file)

```
php artisan directadmin:publish-workflow
```

**What it does:** Creates `.github/workflows/directadmin-deploy.yml` file locally

**Command Options:**

- `--branch=` - Branch to trigger deployment (default: auto-detect)
- `--php-version=` - PHP version for workflow (default: 8.3)

---

### 3. Setup Automated Deployment (Via GitHub API)

[](#3-setup-automated-deployment-via-github-api)

```
php artisan directadmin:setup-cicd
```

**What it does:** Publishes GitHub Actions workflow file locally and creates secrets automatically via GitHub API, and automatically adds deploy keys to your repository

**Command Options:**

- `--token=` - GitHub Personal Access Token (overrides GITHUB\_API\_TOKEN from .env)
- `--branch=` - Branch to deploy (default: auto-detect)
- `--php-version=` - PHP version for workflow (default: 8.3)

**GitHub Personal Access Token Permissions:**Your GitHub Personal Access Token needs the following permissions:

- **Administration** → Read and write (for managing deploy keys for the repository)
- **Metadata** → Read-only (automatically selected, required for API access)

**Note:** The workflow file is published locally to `.github/workflows/directadmin-deploy.yml`. You'll need to review, commit, and push it manually. The command only uses the API to create secrets and deploy keys.

Environment Variables Summary
-----------------------------

[](#environment-variables-summary)

VariableRequired ForDescription`DIRECTADMIN_SSH_HOST`All commandsDirectAdmin server IP address`DIRECTADMIN_SSH_USERNAME`All commandsDirectAdmin SSH username`DIRECTADMIN_SSH_PORT`All commandsSSH port (default: 22)`DIRECTADMIN_SITE_DIR`All commandsWebsite folder name`GITHUB_API_TOKEN`Automated setupGitHub Personal Access Token (requires Administration permission for deploy keys)Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^11.0|^12.0
- SSH access to DirectAdmin server
- Git repository (GitHub recommended)
- **PHP `exec()` function must be enabled** (required for executing SSH commands and process management)

> **Important:** This package requires the PHP `exec()` function to be available and enabled on your system. The `exec()` function is used for executing SSH commands and managing deployment processes. If `exec()` is disabled in your PHP configuration, deployment operations will fail.

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance86

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

8

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f41019bb111a624d7b3cde0fb8a5683c20e119b0004cc8e185dc9435e6231224?d=identicon)[Cocomedia](/maintainers/Cocomedia)

---

Top Contributors

[![ErwinLiemburg](https://avatars.githubusercontent.com/u/55760701?v=4)](https://github.com/ErwinLiemburg "ErwinLiemburg (32 commits)")[![thecodeholic](https://avatars.githubusercontent.com/u/4627922?v=4)](https://github.com/thecodeholic "thecodeholic (20 commits)")

---

Tags

laravelsshdeploymentGithub Actionsdirectadmin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cocomedia-nl-laravel-directadmin-deploy/health.svg)

```
[![Health](https://phpackages.com/badges/cocomedia-nl-laravel-directadmin-deploy/health.svg)](https://phpackages.com/packages/cocomedia-nl-laravel-directadmin-deploy)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M632](/packages/spatie-laravel-medialibrary)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[livewire/flux

The official UI component library for Livewire.

9527.8M126](/packages/livewire-flux)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
