deploy website using ssh

hey guys , I'm new to space , I have a small website and a small project that I'm trying to develop .

this part of website is a simple template and I just need to sync files between repository and server.

my server is an ubuntu server right now .

I tried to use jobs for this and execute SSH commands and then using git pull on the server , but couldn't find a complete guide for it . 

so I'm completely lost on it , is there anything that i can do ? do you think using docker may help ? any suggestions ?

I was considering migrating to GitLab for CI/DI , but i want it to work on space .

I appreciate your help .


Hello! There's no specific guide for it, however, I'll be glad to assist you with this case. Using Space automation for it seems to be a good solution. In general, the process should be the following:

  1. `gitPush` event to the Space repository triggers the automation job.
  2. Automation job runs the Ubuntu Docker container with Bash commands to connect to your server and notify it about the update. This step may require using Secrets and Parameters for passing SSH keys to the job.
  3. The server executes a `git pull` command connecting to the Space repository. This step may require registering a Space Client Application to authenticate in Space easily.

Could you please try this flow and let me know if any additional questions appear?



I have found this post searching for "jetbrains space ssh deployment". I have solved it this way:

1. Create SSH connection parameters

Go to Settings -> Secrets & Parameters

Create following Parameters (key: value):

  • VPS_CMD: name of the bash script which needs to be executed, e.g. /home/user/
  • VPS_HOST: SSH server hostname, e.g.
  • VPS_PORT: SSH port, e.g. 22
  • VPS_PORT: SSH server username, e.g. user

Create following Secrets (key: value):

  • VPS_KEY: SSH private key

Hint: The editor may give you following message entering your SSH private key:

This value contains leading or trailing whitespace characters. If this is unintended, please remove them.

Please ignore this message and leave the trailing carriage return or the private key cannot be used (you'll get a format error).

2. Add Space Automation

Add the file .space.kts to your repository

job("Build and push Docker") {
parameters {
secret("private-key", "{{ project:VPS_KEY }}")
host("Build and push a Docker image") {
fileInput {
source = FileSource.Text("{{ private-key }}")
localPath = "/root/.ssh/id_rsa"
dockerBuildPush {
labels["vendor"] = "Han Solo"
tags {
shellScript {
content = """
set -e
chmod 0400 /root/.ssh/id_rsa
ssh -i /root/.ssh/id_rsa -o "StrictHostKeyChecking=no" {{ project:VPS_USERNAME }}@{{ project:VPS_HOST }} -p {{ project:VPS_PORT }} {{ project:VPS_CMD }}
Hint: You want to modify the container settings (vendor label, tags) or don't use that at all.

3. Prepare SSH target server

Add SSH public key

Add the SSH public key to /home/user/.ssh/authorized_keys (adjust the username)

Add deployment script

Do whatever you like, e.g. /home/user/

cd /home/user/git/falcon/
git pull
Hint: Clone you repository in /home/user/git/falcon/ using SSH key based authentication for example:
git clone ssh://

Please sign in to leave a comment.