---
title: 'Run Laravel Tinker over SSH on a remote server'
description: 'Run php artisan about over SSH, then save the host, user, app path, and environment in LaraBench for repeat Tinker and Artisan commands.'
canonical_url: 'https://larabench.com/laravel-tinker-workflows/run-laravel-tinker-over-ssh'
md_url: 'https://larabench.com/laravel-tinker-workflows/run-laravel-tinker-over-ssh.md'
last_updated: '2026-07-28'
---
# Run Laravel Tinker over SSH on a remote server

> Run php artisan about over SSH, then save the host, user, app path, and environment in LaraBench for repeat Tinker and Artisan commands.

## Direct Answer

Connect to the server, enter the Laravel app root, confirm `php artisan` works, then start Tinker. In LaraBench, save the same host, user, port, app path, and environment once.

## When To Use This

Use SSH for staging or production apps that are not available as a local checkout or Docker container on your machine.

## Terminal Approach

```bash
ssh deploy@demo.example.com
cd /var/www/demo/current
php artisan about
php artisan tinker
```

## LaraBench Approach

Open Connections, choose SSH, enter the remote target and environment, save and test it, then begin in Run Code with the read-only runtime snippet.

## First Snippet

```php
return [
    'app' => config('app.name'),
    'environment' => app()->environment(),
    'laravel' => app()->version(),
    'database' => config('database.default'),
];
```

## Expected Result

The snippet returns the application name, environment, framework version, and default database connection without selecting application records.

## Troubleshooting

- If authentication fails, test the same SSH arguments in the terminal.
- If Artisan is missing, point the app path at the directory containing `artisan`.
- If the wrong release opens, update the app path to the current deployment.

## Safety Notes

Treat every remote run as real application code. Confirm the environment and app path, begin with configuration reads, and remember that dry run cannot undo external side effects.

## Related Sources

- [Laravel Artisan Tinker documentation](https://laravel.com/docs/13.x/artisan#tinker)
- [LaraBench SSH setup docs](https://larabench.com/docs/setup-guides/ssh)
- [LaraBench Run Code docs](https://larabench.com/docs/basic-usage/run-code)

## Related Workflows

- [Read Laravel logs over SSH](https://larabench.com/laravel-tinker-workflows/read-laravel-logs-over-ssh)
- [Check Laravel production with a read-only Tinker snippet](https://larabench.com/laravel-tinker-workflows/safe-laravel-production-check)

## Canonical Page

- [HTML page](https://larabench.com/laravel-tinker-workflows/run-laravel-tinker-over-ssh)
- [Markdown mirror](https://larabench.com/laravel-tinker-workflows/run-laravel-tinker-over-ssh.md)

## Glossary

- [Laravel workflow glossary](https://larabench.com/docs/reference/glossary)

## Sitemap

See the full [sitemap](https://larabench.com/sitemap.md) for all public pages.
