Shift with red gradient lettering

Running Shift
for Docker

Whether for self-hosted repositories or privacy policies, you may wish to run Shift locally. Docker makes that possible by creating the necessary environment for Shift to run directly on your local machine.

Not familiar with Docker? No worries. You'll be running Shift in three easy steps.

Download Docker

First, download the Docker Desktop for your platform.

Build Shift

Next, build the Shift image by running the following command:

docker build -t shift https://laravelshift.com/resources/Dockerfile

This downloads our latest Dockerfile to create the environment for Shift. Depending on your network connection it may take a few minutes to build.

Run Shift

Now you may run Shift with the following command:

docker run -v /path/to/your/project:/project:delegated -e SHIFT_TOKEN=token shift

This will run the Shift Docker image you built in the last step. You will need to adjust some of the options.

  • The -v option creates a file mount between the Docker image and your project files. This is a colon separated value. Only replace the first segment with the full, absolute path to your project. The :/project:delegated is the internal path used by Shift and mount option. Do not change this part.

  • The -e option sets an environment variable for Shift. In this case, set the SHIFT_TOKEN to the one you received when you purchased your Shift for Docker.

Note: On some Linux systems, the Z mount option should be used instead of delegated. For example: -v /path/to/your/project:/project:Z.

When this command finishes, your Shift is complete. Shift will generate a shift.md file in your project path with detailed comments for any additional upgrade steps.

Just like the cloud-based Shifts, changes are performed in atomic commits. These commits are made to the current branch. You may checkout another branch before running this command if you would like to perform the upgrade on separate branch.

By default, Shift will use its own author information when making commits. If you would like to use your own author information, you may set the GIT_AUTHOR and GIT_EMAIL environment variables. For example:

docker run ... -e GIT_AUTHOR="JMac" -e GIT_EMAIL=jmac@example.com -e SHIFT_TOKEN=token shift

Shift will only make commits if your project is within Git repository. If your project is nested within a Git repository, you should mount the path to your Git repository. Shift will automatically find your project based on the location of common files.

If you encounter any issues, email support@laravelshift.com for additional support. Be sure to include the output from running your Shift as well as any shift.log file it generated.

Ready to upgrade? Chose any Shift to upgrade using Docker.

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.