Are you running a WordPress installation on Google Cloud Platform? If so, it is important that you have a system to remotely manage your WordPress files on Google Cloud.
For those of you who are experienced WordPress users, you’ve probably broken your site before. You’re well aware that a simple plugin malfunction or php code error can lock you out of your WordPress site.
When a plugin or code error breaks your WordPress site, you’ll need to be able to manage WordPress files on Google Cloud using a back-end method.
In this type of situation, when you’re unable to access your WordPress dashboard, don’t lose hope. You can still access your WordPress files remotely using an SFTP client.
In the video above I show you step-by-step how to configure an SFTP client for your WordPress Google Cloud installation.
2. Link SDK to your Google Account
After installing Google Cloud SDK, the terminal will open, and you will be asked to log in. Type y and press Enter. Your browser will open up your Google accounts page, asking you to grant permissions for the Google Cloud SDK.
3. Configure Compute Engine
The Google Cloud SDK will now ask if you want to configure Google Compute Engine. Type y and press Enter to continue.Next you will be prompted to select a zone. Either choose the zone that you selected when setting up your instance, or choose 21 to not set a default zone.
4. Run gcloud Command
After selecting your zone, go back to your Google Cloud Platform instance dashboard, and click the arrow next to the SSH button and select View gcloud command.Select and copy your gcloud command.Go back to your SDK terminal and paste the gcloud command.After you paste your gcloud command into the SDK terminal, a PuTTY terminal will launch. Paste you gcloud command into the PuTTY terminal. The PuTTY terminal will generate SSH keys. When asked if you want to enter a passphrase, leave the field empty and press Enter.Your SSH key files will be saved into your computer files. You can locate your keys at: Windows (C:) > users > yourusername > .ssh.
5. Configure SSH Keys in FileZilla
Open FileZilla, and go to Edit > Settings. If you don’t have FileZilla installed, you can download it here.In the settings page, under Connection > SFTP, click on Add key file… to upload your SSH key file.Choose the middle SSH PuTTY key file.
6. Link SSH Key to Google Cloud
Go back to your Google Cloud platform VM instances page, and click on your WordPress instance.Click on the EDIT button on the top of the page next to the VM instances header.Scroll down to the middle of the page where it says You have one SSH key. Click on Show and edit.Go back to your directory where your SSH keys are saved (Windows (C:) > users > yourusername > .ssh) and select the bottom SSH key file. Open the file, and copy the entire text.Paste the entire contents of the key file into the SSH text area on your VM instance page. Select the very last part of the text (which identifies your PC), and delete it.Replace the deleted text with the name of your WordPress installation. If you’re using the Bitnami WordPress installation, you will add bitnami at the end of the text.Next, go up towards the middle of the page and copy the external IP address. Then, scroll to the bottom of the page and click the Save button.
7. Connect to FileZilla
Go back to FileZilla, and paste the external IP address in the host field. Make sure to put sftp:// before it (see picture). In the username field enter bitnami, and click the Quick Connect button to connect your WordPress instance.Success! You are now connected to your WordPress instance and will be able to use the FileZilla SFTP client to easily manage your WordPress files.
Did it work?
If you run into permission errors, click here to fix the problem.
If you are looking for the quick-start version of this tutorial, you can check it out here.