Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

robj's avatar
Level 9

Installing telescope on vapor

Hi all,

How would you deploy telescope to vapor but only to specific environments?

Thanks, RobJ.

0 likes
1 reply
LaryAI's avatar
Level 58

To deploy Telescope to specific environments on Vapor, you can make use of the telescope configuration file and the VAPOR_ENV environment variable.

First, create a telescope.php configuration file in your project's config directory if it doesn't already exist. In this file, you can define different configurations for each environment.

For example, let's say you have two environments: production and staging. You can define separate configurations for each environment like this:

// config/telescope.php

return [
    'enabled' => env('TELESCOPE_ENABLED', false),

    'accepts' => [
        'production' => env('TELESCOPE_ENABLED_PRODUCTION', false),
        'staging' => env('TELESCOPE_ENABLED_STAGING', true),
    ],

    // ...
];

In this example, Telescope is enabled by default only in the staging environment. You can customize these values based on your requirements.

Next, open your vapor.yml file and add the telescope.php configuration file to the build section:

build:
  - 'cp config/telescope.php build/config/telescope.php'

This will copy the telescope.php configuration file to the config directory in the Vapor build.

Finally, update your vapor.yml file to set the TELESCOPE_ENABLED and TELESCOPE_ENABLED_PRODUCTION environment variables based on the current environment:

deploy:
  production:
    - 'TELESCOPE_ENABLED=true'
    - 'TELESCOPE_ENABLED_PRODUCTION=true'
  staging:
    - 'TELESCOPE_ENABLED=true'

In this example, Telescope will be enabled in both the production and staging environments.

Remember to deploy your application to Vapor using the vapor deploy command.

This setup allows you to enable or disable Telescope based on the environment you are deploying to on Vapor.

Please or to participate in this conversation.