Installation of Asciinema on Fedora CoreOS Latest

Asciinema is an open-source tool for recording, sharing, and viewing terminal sessions. Asciinema consists of two parts, the command-line tool for recording and the web application for sharing and viewing sessions. In this tutorial, we will discuss how to install and run the Asciinema server on Fedora CoreOS.

Prerequisites

Before you start this tutorial, you need to ensure that you have the following:

Steps to Install Asciinema Server on Fedora CoreOS

Step 1: Install Required Dependencies

First, update the system package list and install the required dependencies with the following command:

sudo dnf update -y
sudo dnf install -y python3 python3-pip python3-psycopg2 postgresql-server

Step 2: Install Asciinema Server

Now, you can easily install the Asciinema server using Python's pip package manager with the following command:

sudo pip3 install asciinema-server

Step 3: Start the PostgreSQL Server

The Asciinema server requires a PostgreSQL database to store the recorded sessions. To set up the PostgreSQL server, use the following command:

sudo postgresql-setup --initdb --unit postgresql
sudo systemctl enable --now postgresql

Step 4: Initialize the Database

After successfully setting up the PostgreSQL server, you need to create a new user and database for the Asciinema server. Use the following commands to do so:

sudo su - postgres
#create a new user
createuser --pwprompt asciinema-user
# create a new database
createdb -E UTF8 -O asciinema-user asciinema
exit

Step 5: Configure Asciinema Server

Now that you have set up the Asciinema server and the PostgreSQL database, create a new configuration file with the following command:

sudo nano /etc/asciinema/config.yml

Copy and paste the following contents into the configuration file:

db:
  url: postgresql://asciinema-user:<password>@localhost/asciinema
server:
  url: https://asciinema.example.com
  secret_token: <your_secret_token>
  authorized_keys:
  - "ssh-ed25519 AAAA....my-key comment"
  - "ssh-rsa AAAA....my-key comment"

Save and close the file.

Step 6: Start Asciinema Server

Now that you have configured the Asciinema server, you can start the Asciinema server with the following command:

sudo systemctl enable --now asciinema-server

Step 7: Open Firewall Ports

By default, the Asciinema server uses port 80 and 443 to serve the web application. If you are using a firewall, you need to allow these ports to access the Asciinema server. To do so, use the following commands:

sudo firewall-cmd --add-port={80/tcp, 443/tcp} --permanent
sudo firewall-cmd --reload

Step 8: Access the Asciinema Web Application

Now that the Asciinema server is up and running, you can access the web application using your server's IP address or domain name. Open your web browser and navigate to http://<server-ip> or https://<your-domain-name>.

Congratulations! You have successfully installed and configured the Asciinema server on Fedora CoreOS. You can now start recording your terminal sessions and sharing them with others using the Asciinema web application.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!