Ubuntu Linux

Start here to build install Pushkin and its dependencies on Ubuntu Linux.

These instructions were created using Ubuntu 18.04 and the apt package manager. They should generalize to other Linux distributions and package managers, however.

Skip to section

Install curl

First, ensure that you have curl installed, as this will be necessary to download Node.js. If it isn't installed, you can install it using the following commands:

 sudo apt update
 sudo apt install curl

Install Node.js

To install Node.js, first run the following command to install nvm:

 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
 source ~/.bashrc 

Then use nvm to install Node.js:

 nvm install 20.2.0

In case the preferred version of Node.js is changed, use the following commands to update:

 nvm install <node_version>
 nvm use <node_version>

Install and configure Yarn

You will next want to install the Yarn package manager. Official instructions (copied below for convenience) are available here.

Use npm, which comes bundled with Node.js that you just installed:

 npm install --global yarn

Then check that Yarn is installed by running:

yarn --version

To allow Yarn to install pushkin-cli globally, run the following steps, based on this Stack Overflow solution.

Run the following:

 yarn config set prefix ~/.yarn
 echo -e '\nexport PATH="$PATH:`yarn global bin`"\n' >> ~/.bashrc
 source ~/.bashrc

Install Yalc

Install Yalc globally.

 yarn global add yalc

Install pushkin-cli

Next, install the pushkin-cli package globally.

 yarn global add pushkin-cli

Confirm that pushkin-cli is installed by running:

 pushkin --help

You should get a list of commands with some documentation for each.

Confirm that you have version 2.0.0 or later by running:

 pushkin --version

and reading the output.

Install and configure Docker Engine and Docker Compose

Next, install Docker Engine using these instructions (copied below for convenience).

 sudo apt-get update
 sudo apt-get install ca-certificates curl gnupg

Add Docker’s official GPG key:

 sudo install -m 0755 -d /etc/apt/keyrings
 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
 sudo chmod a+r /etc/apt/keyrings/docker.gpg

Use the following command to set up the repository:

 echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Next, update the apt package index:

 sudo apt-get update

Install Docker Engine, containerd, and Docker Compose:

 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin

Check that Docker Engine is installed correctly by running:

 sudo docker run hello-world

If Docker Engine and Docker Compose are installed correctly, this should generate some output, including:

Hello from Docker!
This message shows that your installation appears to be working correctly.

Next, follow these post-installation instructions (copied below for convenience) to manage Docker as a non-root user. (You can ignore the rest of the post-installation instructions.)

 sudo groupadd docker
 sudo usermod -aG docker $USER
 newgrp docker 
 docker run hello-world

Next steps

Great! You're all done. Head over here to build a basic Pushkin site and experiment.

Last updated