Ecode2254/replit-alternative
๐ Replit Alternative โ Free Self-Hosted Coding Environment A fully free, self-hosted coding platform combining the best features from Replit, Gitpod, GitHub Codespaces, and more. Run your own cloud IDE with AI assistance, instant deployments, and collaborative features. โจ Features Feature What You Get ๐ฅ๏ธ Browser IDE Full VS Code in your browser (code-server) ๐ค AI Coding Assistant Local LLM-powered autocomplete & chat (Continue.dev + Ollama) ๐โฆ See the full description on the dataset page: https://huggingface.co/datasets/Ecode2254/replit-alternative.
012
1#!/bin/bash2# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ3# Replit Alternative โ One-Command Installer4# A free, self-hosted coding environment combining the best5# features from Replit, Gitpod, Codespaces, and more.6# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ7 8set -e9 10RED='\033[0;31m'11GREEN='\033[0;32m'12YELLOW='\033[1;33m'13BLUE='\033[0;34m'14NC='\033[0m' # No Color15 16REPO_URL="https://github.com/yourusername/replit-alternative"17INSTALL_DIR="${HOME}/replit-alternative"18 19print_banner() {20 echo -e "${BLUE}"21 cat << "EOF"22 ____ _ __ _ _ _ _ _ _23 | _ \| | | | | | | | | | (_)24 | |_) | | | | | | | | ___ | |_ _ _ __ ___ ___25 | _ <| | | | | | | |/ _ \ | __| | '_ \ / _ \/ __|26 | |_) | |__| | | |__| | __/ | |_| | | | | __/\__ \27 |____/|_____/|_|_____/ \___| \__|_|_| |_|\___||___/28 29 Free Self-Hosted Coding Environment30EOF31 echo -e "${NC}"32}33 34log_info() {35 echo -e "${BLUE}[INFO]${NC} $1"36}37 38log_success() {39 echo -e "${GREEN}[OK]${NC} $1"40}41 42log_warn() {43 echo -e "${YELLOW}[WARN]${NC} $1"44}45 46log_error() {47 echo -e "${RED}[ERROR]${NC} $1"48}49 50check_command() {51 if command -v "$1" &> /dev/null; then52 log_success "$1 is installed"53 return 054 else55 return 156 fi57}58 59install_docker() {60 log_info "Installing Docker..."61 curl -fsSL https://get.docker.com | sh62 sudo usermod -aG docker "$USER"63 log_success "Docker installed. You may need to log out and back in."64}65 66install_docker_compose() {67 log_info "Installing Docker Compose plugin..."68 sudo apt-get update69 sudo apt-get install -y docker-compose-plugin70 log_success "Docker Compose installed"71}72 73generate_password() {74 openssl rand -base64 24 | tr -d '=+/' | cut -c1-1675}76 77setup_environment() {78 log_info "Setting up environment configuration..."79 80 if [ ! -f ".env" ]; then81 cp .env.example .env82 83 # Generate secure passwords84 CODE_PASS=$(generate_password)85 SUDO_PASS=$(generate_password)86 REDIS_PASS=$(generate_password)87 COOLIFY_KEY=$(openssl rand -base64 32)88 89 # Update .env with generated passwords90 sed -i "s/CODE_SERVER_PASSWORD=changeme/CODE_SERVER_PASSWORD=${CODE_PASS}/" .env91 sed -i "s/CODE_SERVER_SUDO_PASSWORD=changeme/CODE_SERVER_SUDO_PASSWORD=${SUDO_PASS}/" .env92 sed -i "s/REDIS_PASSWORD=changeme/REDIS_PASSWORD=${REDIS_PASS}/" .env93 sed -i "s|COOLIFY_APP_KEY=base64:changeme|COOLIFY_APP_KEY=base64:${COOLIFY_KEY}|" .env94 95 log_success "Generated secure passwords in .env"96 echo -e "${YELLOW}"97 echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"98 echo " Your Code-Server Password: ${CODE_PASS}"99 echo " Your Sudo Password: ${SUDO_PASS}"100 echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"101 echo -e "${NC}"102 echo "These are saved in .env โ change them if you want."103 else104 log_warn ".env already exists, skipping generation"105 fi106}107 108pull_models() {109 log_info "Pulling AI coding models (this may take a while)..."110 111 # Wait for Ollama to be ready112 sleep 5113 114 # Pull lightweight models first115 docker compose exec -T ollama ollama pull codellama:7b-code || log_warn "Failed to pull codellama"116 docker compose exec -T ollama ollama pull qwen2.5-coder:7b || log_warn "Failed to pull qwen2.5-coder"117 118 log_success "AI models ready"119}120 121print_access_info() {122 echo ""123 echo -e "${GREEN}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"124 echo -e "${GREEN} ๐ Your Replit Alternative is Ready!${NC}"125 echo -e "${GREEN}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"126 echo ""127 echo -e " ${BLUE}VS Code IDE:${NC} http://localhost:8443"128 echo -e " ${BLUE}Coolify Deploy:${NC} http://localhost:8000"129 echo -e " ${BLUE}File Manager:${NC} http://localhost:8080"130 echo -e " ${BLUE}Uptime Monitor:${NC} http://localhost:3001"131 echo -e " ${BLUE}Portainer:${NC} http://localhost:9000"132 echo -e " ${BLUE}Ollama API:${NC} http://localhost:11434"133 echo ""134 echo -e " ${YELLOW}With custom domains (after DNS setup):${NC}"135 echo -e " ${BLUE}VS Code IDE:${NC} https://code.yourdomain.com"136 echo -e " ${BLUE}Coolify Deploy:${NC} https://deploy.yourdomain.com"137 echo -e " ${BLUE}File Manager:${NC} https://files.yourdomain.com"138 echo -e " ${BLUE}Uptime Monitor:${NC} https://status.yourdomain.com"139 echo -e " ${BLUE}Portainer:${NC} https://docker.yourdomain.com"140 echo ""141 echo -e "${GREEN}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${NC}"142 echo ""143 echo -e " ${YELLOW}Next steps:${NC}"144 echo " 1. Open VS Code at http://localhost:8443"145 echo " 2. Install the 'Continue' extension from the marketplace"146 echo " 3. Start coding with AI assistance!"147 echo ""148 echo -e " ${YELLOW}To add Daytona (dev environment manager):${NC}"149 echo " curl -fsSL https://get.daytona.io | bash"150 echo ""151 echo -e " ${YELLOW}To stop all services:${NC}"152 echo " docker compose down"153 echo ""154 echo -e " ${YELLOW}To view logs:${NC}"155 echo " docker compose logs -f"156 echo ""157}158 159# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ160# MAIN INSTALLATION FLOW161# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ162 163print_banner164 165log_info "Starting installation..."166 167# Check if we're in the right directory168if [ ! -f "docker-compose.yml" ]; then169 log_info "Cloning repository..."170 git clone "$REPO_URL" "$INSTALL_DIR" 2>/dev/null || {171 log_warn "Could not clone repo. Creating directory manually..."172 mkdir -p "$INSTALL_DIR"173 }174 cd "$INSTALL_DIR"175fi176 177# Check prerequisites178log_info "Checking prerequisites..."179 180if ! check_command "docker"; then181 log_warn "Docker not found. Installing..."182 install_docker183fi184 185if ! check_command "docker compose"; then186 log_warn "Docker Compose not found. Installing..."187 install_docker_compose188fi189 190if ! check_command "git"; then191 log_warn "Git not found. Installing..."192 sudo apt-get update && sudo apt-get install -y git193fi194 195log_success "All prerequisites met"196 197# Setup environment198setup_environment199 200# Create required files201touch filebrowser.db202 203# Start services204log_info "Starting services with Docker Compose..."205docker compose up -d206 207# Wait for services to be ready208log_info "Waiting for services to start..."209sleep 10210 211# Pull AI models212pull_models213 214# Print final info215print_access_info216 217log_success "Installation complete!"