Eric Guo's blog.cloud-mes.com

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Deploy Next.js 15.5 via Capistrano Into Self-hosting Rocky Linux 9

Permalink

It's very similar post like deploy to Rocky Linux 8, but this time we using a opencode project, this Next.JS enable you add a login via sso to an existing dify app, which is must need for a enterprise env.

Create a new user

adduser sql_chat
gpasswd -a sql_chat wheel
cd /etc/sudoers.d
# you can later change more limit like "sql_chat ALL=(ALL) NOPASSWD:/usr/bin/systemctl"
echo "sql_chat ALL=(ALL) NOPASSWD:ALL" > 97-sql_chat-user
sudo su - sql_chat
mkdir .ssh
chmod 700 .ssh
vi .ssh/authorized_keys # and paste your public key
chmod 600 .ssh/authorized_keys

and make sure you can login via ssh sql_chat@your_server

Install Node.js 22

curl -sL https://rpm.nodesource.com/setup_22.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo dnf install -y nodejs
sudo yum install gcc-c++ make
sudo npm install -g npm

Fix permissions for the deploy folder

sudo mkdir /var/www
cd /var/www
sudo mkdir sql_chat
sudo chown sql_chat:sql_chat sql_chat/

Comments