{"id":27446934,"url":"https://github.com/iamhelitha/swap-file-setup","last_synced_at":"2026-05-05T09:32:50.126Z","repository":{"id":287703020,"uuid":"965541432","full_name":"iamhelitha/swap-file-setup","owner":"iamhelitha","description":"A lightweight, interactive bash script that automatically sets up and optimizes a swap file on Linux VPS instances. Perfect for low-RAM servers (1GB or less) to prevent out-of-memory errors. Features smart defaults, existing swap detection, and proper system configuration.","archived":false,"fork":false,"pushed_at":"2026-02-20T22:32:05.000Z","size":7,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-21T04:19:56.416Z","etag":null,"topics":["bash-script","debian","devops-tools","linux-servers","memory-management","server-setup","swap-files","system-administration","ubuntu","vps-optimization"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamhelitha.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T11:51:54.000Z","updated_at":"2025-04-13T12:02:05.000Z","dependencies_parsed_at":"2025-08-08T19:45:25.778Z","dependency_job_id":null,"html_url":"https://github.com/iamhelitha/swap-file-setup","commit_stats":null,"previous_names":["iamhelitha/swap-file--setup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamhelitha/swap-file-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhelitha%2Fswap-file-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhelitha%2Fswap-file-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhelitha%2Fswap-file-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhelitha%2Fswap-file-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamhelitha","download_url":"https://codeload.github.com/iamhelitha/swap-file-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhelitha%2Fswap-file-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32643671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","debian","devops-tools","linux-servers","memory-management","server-setup","swap-files","system-administration","ubuntu","vps-optimization"],"created_at":"2025-04-15T05:59:37.557Z","updated_at":"2026-05-05T09:32:50.089Z","avatar_url":"https://github.com/iamhelitha.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💾 Swap File Auto Setup Script\n\nThis script allows you to **easily create and configure swap memory** on your Linux VPS (ideal for low-RAM servers like those with 1GB RAM). It interactively guides you through the process and applies sensible defaults if you just press `Enter`.\n\n---\n\n## 🚀 Quick Install\n\nYou can run this script in **one line** directly from your terminal:\n\n```bash\nbash \u003c(curl -Ls https://raw.githubusercontent.com/iamhelitha/swap-file-setup/main/install.sh)\n```\n\n---\n\n## 📌 Features\n\n- Interactive terminal prompts with default options\n- Auto-creates and enables a swap file\n- Configures swappiness and cache pressure\n- Works with `fallocate` or falls back to `dd`\n- Permanently persists settings across reboots\n- Detects and updates existing swap files if requested\n\n---\n\n## 🖥️ Supported Operating Systems\n\n- Ubuntu (16.04 and above)\n- Debian (9 and above)\n- Other systemd-based Linux distributions (may require minor tweaks)\n\n\u003e ⚠️ Not tested on CentOS, Fedora, or Alpine — feel free to open issues if you'd like support added!\n\n---\n\n\n## 🛠️ What It Does\n\n1. Checks if swap is already enabled and offers to update it\n2. Asks for the desired swap size (e.g. `1G`, `512M`) — defaults to `1G`\n3. Creates a swap file and enables it\n4. Configures `vm.swappiness` and `vm.vfs_cache_pressure`\n5. Adds swap file to `/etc/fstab` for persistence\n6. Shows memory status at the end\n\n---\n\n## 🧩 Example Output\n\n```bash\n==============================\n  SWAP FILE SETUP FOR VPS\n==============================\n\nEnter swap size (e.g., 1G, 512M) [default: 1G]:\n[*] Creating a 1G swap file at /swapfile...\n\n[✓] Swap successfully enabled with 1G\n```\n\n---\n\n## 🙋‍♂️ Why Use Swap?\n\nSwap helps extend available memory when RAM is full — crucial on small VPS servers where running MySQL, Apache, Node, or other services can cause memory pressure.\n\n---\n\n## 📃 License\n\nMIT License. Use freely and modify as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamhelitha%2Fswap-file-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamhelitha%2Fswap-file-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamhelitha%2Fswap-file-setup/lists"}