Setting Up Laravel with Hoop: A Guide to Secure REPL Access
In this guide, we'll walk through the process of setting up a Laravel application on Ubuntu and integrating it with Hoop to provide secure REPL access. Hoop offers a safer way to interact with your Laravel application through Tinker, providing enhanced security and control over your REPL sessions.
Prerequisites
Before we begin, ensure you have:
* A Ubuntu server (this guide has been tested on Ubuntu 24.04 LTS)
* Root or sudo access to the server
* Basic familiarity with command line opera
Free White Paper
VNC Secure Access + Customer Support Access to Production: The Complete Guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
Andrios Robert
In this guide, we'll walk through the process of setting up a Laravel application on Ubuntu and integrating it with Hoop to provide secure REPL access. Hoop offers a safer way to interact with your Laravel application through Tinker, providing enhanced security and control over your REPL sessions.
Prerequisites
Before we begin, ensure you have:
A Ubuntu server (this guide has been tested on Ubuntu 24.04 LTS)
Root or sudo access to the server
Basic familiarity with command line operations
Hoop CLI installed on your local machine
Local Machine Setup
Before configuring the server, we need to set up the Hoop CLI on your local machine to obtain the organization key and open REPL sessions.
Installing Hoop CLI Locally
First, install the Hoop CLI on your local machine:
curl -s -L https://releases.hoop.dev/release/install-cli.sh | sh
Configuring Hoop CLI and Authentication
Configure the CLI to point to your Hoop instance and login:
This command installs PHP along with essential extensions like GD for image processing, MySQL driver, cURL for HTTP requests, and others required by Laravel.
Continue reading? Get the full guide.
VNC Secure Access + Customer Support Access to Production: Architecture Patterns & Best Practices
Free. No spam. Unsubscribe anytime.
Installing the Hoop CLI
Hoop provides a command-line interface that we'll use to manage proxy the terminal of your server to local clients. Install it using:
curl -s -L https://releases.hoop.dev/release/install-cli.sh | sh
Setting Up Composer and Creating a Laravel Application
Next, we'll install Composer, PHP's package manager, and use it to create a new Laravel application:
# Install Composer globally
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
# Create a new Laravel application
cd $HOME
composer create-project laravel/laravel my_app
Configuring PsySH for Tinker
Laravel's Tinker uses PsySH under the hood. To ensure smooth operation with Hoop, we need to configure PsySH to avoid certain process control functions:
Let's verify that everything works by running a simple command:
> print('hello from hoop')
You should see:
hello from hoop⏎
= 1
Using the Web Interface
For an even more convenient experience, you can access your REPL through Hoop's web interface:
Visit the Hoop webapp
Select the artisan-demo connection
Try running the same test command to verify the connection
Conclusion
You now have a Laravel application set up with secure REPL access through Hoop. This setup allows you to safely interact with your application's runtime environment while maintaining security and control over who can access the REPL and what they can do with it.
Get started
See hoop.dev in action
One gateway for every database, container, and AI agent. Deploy in minutes.