
Deploying the Kutt URL shortener on Rocky Linux 9.4 (Blue Onyx) involves several steps, from setting up your server environment to configuring Docker and troubleshooting potential issues. This guide provides a comprehensive walkthrough based on personal experience to help you get Kutt up and running smoothly.
Prerequisites
- A Rocky Linux 9.4 server: Ensure you have access to a server running Rocky Linux 9.4.
- Root or sudo access: You need administrative privileges to install packages and configure the system.
- Basic knowledge of Docker and Docker Compose: Familiarity with Docker is essential for this deployment.
Step 1: Update Your System
First, make sure your server is up to date.
sudo dnf update -y
Step 2: Install Required Packages
Install Docker, Docker Compose, and other necessary packages.
sudo dnf install -y docker docker-compose git
Start and enable Docker service.
sudo systemctl start docker
sudo systemctl enable docker
Step 3: Clone the Kutt Repository
Clone the Kutt repository from GitHub.
git clone https://github.com/thedevs-network/kutt.git
cd kutt
Step 4: Configure Environment Variables
Create a .env file in the root of your cloned repository and add the following configuration. Replace placeholders with your actual values.
# .env file
# General settings
PORT=3000
NODE_ENV=production
SITE_NAME=Kutt
DEFAULT_DOMAIN=yourdomain.com
JWT_SECRET=your_jwt_secret
# PostgreSQL settings
DB_HOST=postgres
DB_NAME=kutt
DB_USER=postgres
DB_PASSWORD=your_postgres_password
# Redis settings
REDIS_HOST=redis
# Gmail SMTP settings
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_SECURE=false
MAIL_USER=your_gmail_address@gmail.com
MAIL_PASSWORD=your_app_password
# URL length
LINK_LENGTH=6
# Google Safe Browsing API (optional)
# GOOGLE_SAFE_BROWSING_KEY=
# Recaptcha (optional)
# RECAPTCHA_SECRET_KEY=
# RECAPTCHA_SITE_KEY=
# Google Analytics (optional)
# GA_TRACKING_ID=
Step 5: Configure Docker Compose
Create or modify the docker-compose.yml file to include the necessary services.
version: "3"
services:
kutt:
image: kutt/kutt
depends_on:
- postgres
- redis
command: ["./wait-for-it.sh", "postgres:5432", "--", "npm", "start"]
ports:
- "3000:3000"
env_file:
- .env
networks:
- kutt_network
redis:
image: redis:6.0-alpine
volumes:
- redis_data:/data
networks:
- kutt_network
postgres:
image: postgres:12-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: your_postgres_password
POSTGRES_DB: kutt
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- kutt_network
volumes:
redis_data:
postgres_data:
networks:
kutt_network:
driver: bridge
Step 6: Modify Kutt Source Files
You may need to add logging and troubleshooting code. For example, in server.ts, add logging for signup errors.
// server/handlers/auth.ts
export const signup: Handler = async (req, res) => {
console.log(`Signup request received: ${JSON.stringify(req.body)}`);
try {
const salt = await bcrypt.genSalt(12);
const password = await bcrypt.hash(req.body.password, salt);
const user = await query.user.add(
{ email: req.body.email, password },
req.user
);
await mail.verification(user);
return res.status(201).send({ message: "Verification email has been sent." });
} catch (error) {
console.error(`Error during signup: ${error.message}`);
return res.status(500).send({ message: "Failed to signup. Please try again later." });
}
};
Step 7: Build and Start Docker Containers
Build and start your Docker containers.
sudo docker-compose build
sudo docker-compose up -d
Step 8: Configure Firewall
Ensure your firewall allows traffic on the necessary ports.
sudo firewall-cmd --permanent --add-port=3000/tcp
sudo firewall-cmd --permanent --add-port=5432/tcp
sudo firewall-cmd --permanent --add-port=6379/tcp
sudo firewall-cmd --permanent --add-port=587/tcp
sudo firewall-cmd --reload
Step 9: Test the Deployment
- Access the Kutt web interface: Open your browser and navigate to
http://yourdomain.com:3000. - Signup and verify: Register a new account and verify the email using the link sent to your email.
Troubleshooting
SMTP Issues: If you encounter SMTP connection issues, ensure the firewall settings are correct and the SMTP credentials are accurate.
Database Connection: Verify PostgreSQL and Redis services are running and accessible from the Kutt container.
Logs: Check Docker logs for errors.
sudo docker logs st-kutt-1
sudo docker logs st-postgres-1
sudo docker logs st-redis-1
Additional Changes
You might need to adjust some configurations in your package.json to ensure dependencies are installed correctly.
{
"name": "kutt",
"version": "2.7.4",
"scripts": {
"start": "npm run migrate && cross-env NODE_ENV=production node production-server/server.js",
"migrate": "knex migrate:latest --env production",
"build": "rimraf production-server && tsc --project tsconfig.json && copyfiles -f 'server/mail/*.html' production-server/mail && next build client/"
},
"dependencies": {
"bcryptjs": "^2.4.3",
"cross-env": "^7.0.3",
"express": "^4.17.1",
"knex": "^0.95.4",
"mail": "^1.0.0",
"next": "10.0.5",
"nodemailer": "^6.6.3",
"pg": "^8.5.1",
"rimraf": "^3.0.2",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
}
}
Conclusion
Deploying Kutt on Rocky Linux 9.4 involves several steps, but with the correct configurations and troubleshooting, you can get it up and running smoothly. This guide should help you navigate through the process and resolve common issues related to SMTP, Docker, and environment configurations. Happy URL shortening!
qojnjlmuztsigelkgzhywpypmzefmm
rgtulqwmspdrqygwwzvrlkduekgmpf
xmsjxvquzwuzjvkxlnnrmjqwlrgekn
roftowlexksrgyrggipnpokovgdmoq
solgosxutztmgeprwuoojluphemxjr
tfvoqirfipvymnhhmxtofgvsltinwk
qmereqgmwmineulevttzlgtopwsplh
yjwnsdlunpkogpjndfkxhtwutuonfk
yilkjknthdlssjinyhrztitzqlvytg
sxhmqxgxxhtzfykgnizzfdsiehmtnj
vvxesghfjspyyzqomhxuuwyrddvhns
Gotta say, enjoyed my time on jogodeourobet. The layout is clean and easy to navigate, even on mobile. Found some great deals too! You can find the site here: jogodeourobet
188be is where I make my bets, man. Good odds, easy to navigate, and they pay out quick, no messing about. Put your money where your mouth is at 188be!
yohohoio has caught my eye! Been checking it out and it’s got some cool stuff going on. I’d recommend taking a look if you get the chance. Find them down below: yohohoio
Lo666… the name’s a bit intense, haha. Overall a decent experience. Give lo666 a go — maybe you’ll have better luck than me!
Hey, anyone tried net12? It looks kinda sus, but maybe it’s worth a shot. Just trying to get my fix for the weekend. net12
Heard good things about b2xbetgames.info so I gave it a shot. Good games, nice bonuses, and withdrawals were processed without any hassle. I’ll be back. b2xbetgames
Quick look at h2bt – seems to be pointing towards some decent betting platforms. Worth a check if you’re exploring different options. Take a look at: h2bt
Lotuu… Not heard of them before. Is it any good? Anyone had any luck winning on lotuu? Spill the beans, I’m curious!
Downloading the 100winapp now! Seems convenient to have on the go. Fingers crossed for some mobile wins! Definitely worth a look: 100winapp
Trying to get back into ah77 and ah77login is making it easy peasy! No more forgotten passwords, hopefully! ah77login
GameZoneApp? Ooh, a new app for my phone! Downloading it now. Hope it has some killer games. Fingers crossed! gamezoneapp
Keo 88, okay, heard of it. What are the odds like compared to others? That’s what I wanna know. keo 88
He probado varios sitios, pero Win92 tiene algo especial. Me gusta la variedad de juegos y la atención al cliente siempre es rápida. Dale una oportunidad a win92, ¡quizás te enganches como a mí!
Si eres fan del poker como yo, Betpkrgame es tu lugar. Siempre hay mesas disponibles y la competencia es buena. ¡Afila tus habilidades y visita betpkrgame!
CM8 es un sitio de confianza donde siempre encuentro lo que busco. La página es rápida y la atención al cliente es excelente. Te recomiendo visitar cm8. ¡No te arrepentirás!
DrfSqjGFaEinlgsYDtWj
Just throwing it out there that zero1bet seems pretty slick. Might be the change of pace you’re looking for. Check this out: zero1bet
Hey dudes! betap caught my eye, maybe it’ll catch yours too! Give it a look-see! Let the good times roll: betap
Alright, checking out betipix365! Heard some buzz about their odds. Gonna give it a whirl and see if it lives up to the hype. Fingers crossed for some wins! Check them out at betipix365
Trying to login to jilievoclublogin. Hope it’s easy! Anyone else a member? Let’s get this bread. Try logging in here – jilievoclublogin
Alright, time for some judi bola with 828bet nih! Anyone else into this? Kasiyakan toh! Let’s go! Check it out, bro – judi bola 828bet nih
Alright fellas, looking to hit that Jilibet jackpot with GCash? Head on over to jilibet gcash for some tips. Good luck, and remember to play responsibly!
Yo, checked out PK88s. Not bad at all! Fast withdrawals, that’s what I’m talking about. Worth a look if you’re hunting for a new spot. Link’s right here: pk88s.
S66 plus? It’s got some good stuff, I’ll say that. Worth checking out their promotions, they usually have something interesting. Dive in here: s66 plus.
SA88bet, yeah I’ve played there. Decent odds and a reliable platform. Nothing groundbreaking, but solid. Give it a try: sa88bet.
If you’re after soi cầu xsmb kubet predictions, this site’s got ‘em. Use them wisely. Don’t bet the house based on any predictions, but it can offer some insights. Good luck! soi cầu xsmb kubet
Just wanted to shoutout this ‘soi cầu kubet’ site I stumbled upon. Predictions seem promising. Gonna give it a try. You guys should check it out!: soi cầu kubet
Wondering about the Superbet VIP program. Heard it’s got some sweet perks if you’re a high roller. Might be something to aim for if you’re serious about your gaming. See what the fuss is about: superbet vip
glImUYZubkPersxTCKuO
Hey guys, check out VN 123.vin. Been playing for a bit and it’s pretty addictive. Some different games than I’ve seen elsewhere. Might be your new fav spot: vn 123.vin
VN888Game…Alright, alright, let’s see whatcha got! Anyone else playing on VN888Game? What are the must-try games? Give it a look: vn888game.
Vua Trò Chơi! Oh man, takes me back! If you’re looking for some awesome king of games action, vtco game is the place to be. Check it: vua trò chơi.
Spotted ‘kèo nhà cái 5.com’ on keonhacai55bet.com and thought I’d give it a shoutout. Got some decent value with them last week, hopefully they keep the good bets coming. Check ‘em out: kèo nhà cái 5.com
Yo, for those interested in m7 ma cao, give this site a look. It’s got what you need! Seriously good stuff! See for yourself: m7 ma cao
Tava na dúvida de jogo de ouro bet como sacar, mas achei as instruções bem claras no site. Sem mistério, o dinheiro caiu na conta rapidinho. Get those earnings quickly jogo de ouro bet como sacar.
BMWcasino treats you like royalty. The games are top-notch and the customer support is always helpful. Feels like you’re playing at a real casino. bmwcasino
PHSuperlinklogin, it’s my go-to! Easy navigation and keeps things interesting. Check it out if you’re looking for some fun! phsuperlinklogin
Roobetlogin is pretty slick. I’ve had some decent luck logging in and playing. Solid site! roobetlogin
Just checked out 7ezbdapp, not bad! Seems like a decent place to try my luck. I’ll give it a shot and see how it goes. Definitely worth a look if you’re after some online fun 7ezbdapp
222bdbet hmm, never heard of it before but willing to check things out. I might give it a small try with a little cash, let’s see how this spins. Good luck to us all 222bdbet
Mex66casino alright, I’m looking to get some new online action. Does it have any special promotions? I am really curious about the features. Hopefully it’s worthwhile mex66casino
Sweet, Jeet game download. Is it fast and safe? I always worry about sketchy downloads. But if this is clean, sign me up! Ready to game
Need to see Rồng Bạch Kim? This is your one-stop shop! Find out more: cho xem rồng bạch kim
Gamvip.club claims to be an international gaming portal. Is it really a global platform? Has anyone played from outside of Vietnam? gamvip.club – cổng game quốc tế
Spotted 111bet, taking a gamble checking it out. Hopefully it’s legit and fun! Check it out here:111bet
Trying to log into 789bet? Make it as easy to hit that jackpot! Worth a lookup here: 789betdangnhap
Heard about axiebet888, so I’m checking it out, curious to see if it is any good! Take a peak here: axiebet888
Se você gosta de jogos competitivos, Nulls Brawl é uma excelente alternativa. Com servidores privados, você pode testar habilidades, desbloquear itens rapidamente e jogar com amigos. Nulls Brawl continua crescendo entre usuários que querem mais liberdade dentro do jogo.
CLB88Game, nice. It has a good selection that keeps things interesting. The link would be clb88game.
Found myself on 17WinPkrGame the other day. Had a good little session. Worth checking out if you’re looking for a quick game online. Visit 17winpkrgame.
Just used 585BetLogin, didn’t have any problems. Easy to use, and pretty standard. Go on and 585betlogin.