Deploy existing Kirby project to uberspace

Hi all,

I tried to find a solution in the depths of this forum but wasn’t really successful. Unfortunately, I am somewhat of a novice when it comes to web hosting and servers, so please excuse any logical flaws in my explanation.

I’m trying to deploy a Kirby 3 project (based on the plainkit) on a web server, namely uberspace.

I have tried the following:

  • Setting up GitHub actions to deploy the entirety directly when pushing to git

If anyone is interested that would be the workflow:

      - main
    runs-on: ubuntu-latest
      - uses: actions/checkout@v2
      - name: rsync deployments
        uses: burnett01/rsync-deployments@4.1
          switches: -avzr --delete
          path: /
          remote_path: /home/${{ secrets.UBERSPACE_USER }}/html/
          remote_host: ${{ secrets.UBERSPACE_HOST }}
          remote_user: ${{ secrets.UBERSPACE_USER }}
          remote_key: ${{ secrets.DEPLOY_KEY_PRIVATE }}

  • The deployment itself seems to be set up correctly, I believe. However, this caused an internal server error 500 when trying to access the domain

  • I have then made sure to change the php version on my space to php 8.0.

  • I have also uncommented RewriteBase /

  • After it was still not working (I believe I got this PHP error in my log at that point PHP Warning: require(kirby/bootstrap.php): Failed to open stream: No such file or directory in, I found in a thread here the following command: git submodule update --init --recursive, which at least led to the page being loaded

However, neither images, nor subpages nor the panel would be accessible. I thought that maybe the media folder being pushed from git might be the issue, so

  • I also tried deleting the media folder and letting Kirby create it from scratch on the server.

Unfortunately, this did not help either.

As I could not get it to work with the GitHub Deployment, I have tried just pushing the project from Local to Remote via SFTP, unfortunately though it results in very similar issues.

When I follow the composer-based instruction on uberspace to install Kirby from scratch, it works like a charm.

Do you guys have any ideas on how to deploy an existing (local or GitHub-based) Kirby 3 project (preferably on Uberspace)? Or should I just use a fresh install and overwrite the folders as needed? I don’t know, I would have loved to have an automated git workflow :confused:

This is not just because I have not bought the license yet, right? :open_mouth:

Any help or suggestions would be much appreciated.

Thanks so much

Edit: I got it to work by installing the plainkit via composer on uberspace and overwriting the assets, content and site folders via SFTP. Is this the easiest way to go?

When the home page work but neither subpages nor the Panel nor images, that usually means that the .htaccess with the rewrite rules is missing (or URL rewriting is not enabled, but I know that it usually is on Uberspace, and since you got the composer installation working, this is not the issue).

If you are installing into a subfolder without its own domain, you might have to set the RewriteBase in .htaccess.

Installing on Uberspace is usually no issue.

And no, it’s not a missing license issue (but of course you need a license on a public server if it’s not just for testing).

Thank you for the quick reply.

I have no clue what’s going on, to be honest. The .htaccess file of the working composer-installed deployment does have RewriteBase commented out, so it does not seem to be necessary at all in my case.

I have even copied the exact same .htaccess file from the working installation down to my local project and pushed it once again.

As mentioned, just replacing the assets, content and site folders with my local ones works. However, uploading all my local project folders and files in the working remote project (installed via composer plainkit) results in the same issue with images and subpages not being accessible.

I have set up Kirby as a sub module to keep it updated (not sure if that is an issue).

Is there anything I can provide that would help solve this?

Edit: I was using the built-in PHP server php -S localhost:8000 kirby/router.php. Just to be sure I downloaded MAMP and there, the project behaves the same way as on uberspace (i.e. not showing images, subpages etc.). Interesting.

Posting a separate reply as I got it working:

The local project not working in MAMP led to me re-installing a new plainkit into my local project. This got it working in MAMP and (after doing the git submodule update --init --recursive) also on uberspace.

Seems like something was messed up with my local installation of Kirby. Sorry for the confusion. :slight_smile: