Skip to main content

Lampsible

About

Complete LAMP stack setup, with a single CLI command. Powered by Ansible under the hood. This tool can automate almost anything that you'd expect from a LAMP stack.

Features

  • Production ready web apps, powered by LAMP stacks, in a single command
  • SSL certificates via Certbot / Let's Encrypt
  • Most common CMS applications are supported:
    • WordPress, including custom themes and plugins
    • Joomla
    • Drupal
    • TYPO3
  • Custom Laravel apps
  • Fresh, out-of-the-box LAMP stacks
  • Custom Apache configuration (custom webroot, vhosts, etc.)
  • Apache or MySQL by itself
  • SSL via test certificates / self signed, ideal for test environments
  • Custom PHP extensions, php.ini settings, phpMyAdmin, Composer packages, etc.
  • Misc. apps: SuiteCRM
  • And so on...

Requirements

  • Local host: Unix system with Python 3.9 or newer. Tested on Ubuntu Linux, Gentoo Linux and Linux Mint. Might work on macOS, but I haven't tested that. Won't work on Windows, because Ansible requires a Unix like system.
  • Remote server: Ubuntu >= 20, <= 24. You need SSH access and root privilege.
  • (Optional): Lampsible is designed so that you run it in your local CLI, and it installs a web app on your remote server. However, you can also run it locally. This is useful if you want to install a local test server. In that case, your local machine should be similar as the "remote server" outlined above, ie. Ubuntu Linux.

Installing

Pip

pip install lampsible

Alternative: from source

git clone https://github.com/belal-i/lampsible
cd lampsible
python3 -m pip install .

Usage

There are 2 ways to use Lampsible: as a CLI tool, or as a Python library.

CLI tool

Once you've installed Lampsible onto your local environment, you can run the lampsible command.

It takes the format: lampsible user@host ACTION [OPTIONS]

If you are running locally, you can simply do: lampsible localhost ACTION [OPTIONS]

It is designed to be very simple to use. If you omit some important parameter, like admin user, password, site title, etc, you will be prompted to enter a value, or fall back to a default.

Below are some examples:

  • Install a production ready WordPress site:

    lampsible someuser@somehost.com wordpress \
        --email-for-ssl you@yourdomain.com
    
  • Install a production ready WooCommerce shop with some other plugins and a custom theme:

    lampsible someuser@somehost.com wordpress \
        --email-for-ssl you@yourdomain.com \
        --wordpress-plugins woocommerce,wordpress-seo,akismet,wordfence \
        --wordpress-theme frutiger-aero
    
  • Install a production ready Joomla site, add the www. subdomain to the website's domain config:

    lampsible someuser@somehost.com joomla \
        --email-for-ssl you@yourdomain.com \
        --www-subdomain
    
  • Install Drupal on a test server. Certbot will set up a test certificate. Also, Apache and MySQL will run on two separate hosts, and MySQL will use a nonstandard port.

    lampsible someuser@somehost.com drupal \
        --database-system-user-host otheruser@dbserver.somehost.com \
        --database-host 10.0.1.2 \
        --database-username dbuser \
        --database-port 6033 \
        --ssl-test-cert \
        --apache-server-admin you@yourdomain.com
    
  • Set up a LAMP stack with various custom configuration and a self signed SSL certificate on some local VM:

    lampsible someuser@192.168.123.123 lamp-stack \
        --ask-remote-sudo \
        --ssl-selfsigned \
        --database-username dbuser \
        --database-name testdb \
        --apache-vhost-name some-legacy-app \
        --apache-document-root /var/www/html/some-legacy-app/some-dir/public \
        --php-extensions mysql,xml,mbstring,xdebug,gd
    

Run lampsible --help for a full list of options.

Python library

Lampsible can be used as a Python library, so if you want to build your own tool, and want to leverage Lampsible's features to automate various Apache webserver setups, you can do that.

It could look something like this:

# my_automation_tool.py

from lampsible.lampsible import Lampsible

# Simple WordPress setup
lampsible = Lampsible(
    web_user='someuser',
    web_host='somehost.example.com',
    action='wordpress',
    # Required for Certbot. You can also use email_for_ssl
    apache_server_admin='someuser@example.com',
    database_name='wordpress',
    database_username='db-user',
    database_password='topsecret',
    admin_username='your-wordpress-admin',
    admin_email='wp-admin@example.com',
    admin_password='anothertopsecret',
    site_title='My WordPress Blog',
    wordpress_plugins=[
        'akismet',
        'wordpress-seo',
        'wordfence',
    ],
)

result = lampsible.run()


# Joomla setup. This example is a little more complex,
# to showcase some more features. Webserver and
# database server are two different hosts,
# a database root password will be set.
# Certbot will run with the --test-cert flag,
# an older version of Joomla will be installed,
# some custom PHP extensions will be installed
# alongside the ones required by Joomla,
# and some extra environment variables will be set.
lampsible = Lampsible(
    web_user='someuser',
    web_host='somehost.example.com',
    # This assumes that you want your database server
    # to be reachable from the outside via the
    # domain dbserver.example.com, and within your
    # internal network, including your Joomla webserver,
    # via the private IP address 10.0.1.2.
    database_system_user='root',
    database_system_host='dbserver.example.com',
    database_host='10.0.1.2',
    action='joomla',
    email_for_ssl='someuser@example.com',
    ssl_test_cert=True,
    database_name='joomla',
    database_username='db-user',
    database_password='topsecret',
    database_root_password='supertopsecret',
    admin_username='your-joomla-admin',
    admin_email='joomla-admin@example.com',
    admin_password='anothertopsecret',
    # These extensions will be appended to the list of
    # extensions required by the system you are
    # installing (in this case Joomla).
    php_extensions=['php-curl', 'php-gd'],
    joomla_admin_full_name='Your Name',
    joomla_version='5.1.4',
    site_title='My Joomla Site',
    extra_env_vars={'FOO': 'bar', 'HELLO': 'world'}
)

result = lampsible.run()

FAQ

  • Why not just use Docker?

Lampsible is intended to be an homage to the old school: A simple and versatile LAMP stack. For a similar tool, that deploys production ready web apps via Docker containers, consider using Dokku Scrubs, another project that I maintain. It is a convenient CLI wrapper around Dokku, an excellent and lightweight open source PaaS tool.

Metadata

Release files for lampsible 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lampsible 2.7.1
File Size Uploaded
lampsible-2.7.1.tar.gz 47.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lampsible 2.7.1
File Interpreter ABI Platform
lampsible-2.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 98.5 kB

Release files / lampsible-2.7.1.tar.gz

Download URL lampsible-2.7.1.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b655dd5496f7abf279eaaa3a632412563c4575187f396c78a2c2c0fc8e312c8c
BLAKE2b-256 checksum
How to use checksums
81cefdf1f91e4b086f8aaed3d798f48b45aa1edd2f641f36877dd1107032e9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / lampsible-2.7.1-py3-none-any.whl

Download URL lampsible-2.7.1-py3-none-any.whl
Size 51.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d9718f31d15064922a64a18be9d1f0ca625b18465160ec0bd1adaea587d4ab3
BLAKE2b-256 checksum
How to use checksums
ffb5e011a499fba4325d611f1a7fedadfd647075ec6bb5bf6d38e87f838ffe0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.7.1 This release

2 release files

2.7.0

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page