<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jayani-n on Medium]]></title>
        <description><![CDATA[Stories by Jayani-n on Medium]]></description>
        <link>https://medium.com/@hckr8079?source=rss-5dd975c4aaa3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o_d3iK1_VpDAS5FkYEy8uw.png</url>
            <title>Stories by Jayani-n on Medium</title>
            <link>https://medium.com/@hckr8079?source=rss-5dd975c4aaa3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:26:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hckr8079/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Beginner’s Guide to Hosting a CTF on AWS Using CTFd]]></title>
            <link>https://medium.com/@hckr8079/a-beginners-guide-to-hosting-a-ctf-on-aws-using-ctfd-46306a8f2305?source=rss-5dd975c4aaa3------2</link>
            <guid isPermaLink="false">https://medium.com/p/46306a8f2305</guid>
            <category><![CDATA[hosting-ctf-on-aws]]></category>
            <dc:creator><![CDATA[Jayani-n]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 09:26:00 GMT</pubDate>
            <atom:updated>2026-03-03T09:26:00.727Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*afyqIGWm1aoJMIPP.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qOwZBRLN9VnqTcpm.jpg" /></figure><h3>1. Introduction</h3><p>Capture The Flag (CTF) competitions have become one of the most effective ways for students and professionals to improve hands-on cybersecurity skills. Whether you are organizing a college-level event or a small internal competition, choosing the right platform and infrastructure is essential.</p><p>This guide provides a clear, beginner-friendly yet professional walkthrough of how to deploy <strong>CTFd</strong> on <strong>Amazon Web Services</strong>, using a free-tier <strong>EC2</strong> instance. The process is reliable, cost-effective, and scalable enough for hosting a 4–6 hour CTF smoothly.</p><h3>2. Prerequisites</h3><p>Before you begin, ensure you have:</p><ul><li>An <strong>AWS Free Tier account</strong></li><li>A basic understanding of Linux terminal commands [can be learnt while doing also:)]</li><li>A working SSH client (Windows Terminal or PuTTY)</li></ul><h3>3. Launching an EC2 Instance on AWS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vdZW_4_aGDAZl6bL.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/0*UR5ST3CRolpATmeb.png" /></figure><h3>Step 1: Log in to AWS</h3><p>Navigate to the AWS Console → <strong>EC2 Dashboard</strong>.</p><h3>Step 2: Launch Instance</h3><ul><li><strong>Name:</strong> CTFd-Server</li><li><strong>AMI:</strong> Ubuntu Server 22.04 LTS (recommended)</li><li><strong>Instance Type:</strong> t3.micro (Free Tier eligible)</li></ul><h3>Step 3: Create Key Pair</h3><p>Download and store a .pem key securely.</p><h3>Step 4: Configure Security Group</h3><p>Allow the following inbound rules (to allow traffic):</p><ul><li><strong>22</strong> → SSH</li><li><strong>80</strong> → HTTP</li><li><strong>443</strong> → HTTPS (for SSL later)</li><li><strong>8080 </strong>(or any port) -&gt; Custom TCP</li></ul><h3>Step 5: Launch</h3><p>After launching, note your <strong>Public IPv4 Address</strong>.</p><p>(On a free tier-&gt; Elastic ip can’t be configured (keeps the ip constant))</p><h3>4. Connect to the EC2 Server via SSH</h3><pre>ssh -i yourkey.pem ubuntu@EC2_PUBLIC_IP<br><br><br>Eg: ssh.exe -i &quot;ctfd.pem&quot; ubuntu@ec2-&lt;ip&gt;.compute-1.amazonaws.com</pre><p>Once logged in, update the system:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><h3>5. Install Docker and Docker Compose</h3><p>Docker is the recommended way to deploy CTFd efficiently.</p><pre>sudo apt install docker.io docker-compose -y<br>sudo systemctl enable docker<br>sudo usermod -aG docker ubuntu</pre><p>Re-login to apply permissions.</p><h3>6. Deploying CTFd Using Docker Compose</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eJUtY-saRM3sfMFV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UQ8IZY9CqZfu9yqd.jpeg" /></figure><h3>Step 1: Create Project Directory</h3><pre>mkdir ctfd<br>cd ctfd</pre><h3>Step 2: Create the docker-compose.yml file</h3><pre>version: &#39;3&#39;<br>services:<br>  ctfd:<br>    image: ctfd/ctfd<br>    restart: always<br>    ports:<br>      - &quot;80:8000&quot;<br>    volumes:<br>      - ./data:/var/uploads<br>      - ./db:/opt/CTFd/CTFd/db</pre><p>Example docker-compose.yml (worked for me; db persistent)</p><pre>version: &quot;3.9&quot;<br><br>services:<br>  ctfd:<br>    image: ctfd/ctfd:latest<br>    restart: always<br>    ports:<br>      - &quot;80:8000&quot;<br>    environment:<br>      UPLOAD_FOLDER: /var/uploads<br>      DATABASE_URL: mysql+pymysql://ctfd:ctfd@db/ctfd<br>      REDIS_URL: redis://cache:6379<br>      WORKERS: 1<br>      LOG_FOLDER: /var/log/CTFd<br>      ACCESS_LOG: &quot;-&quot;<br>      ERROR_LOG: &quot;-&quot;<br>      REVERSE_PROXY: &quot;true&quot;<br>    volumes:<br>      - ./data/logs:/var/log/CTFd<br>      - ./data/uploads:/var/uploads<br>    depends_on:<br>      - db<br>      - cache<br><br>  db:<br>    image: mariadb:10.11<br>    restart: always<br>    environment:<br>      MARIADB_ROOT_PASSWORD: ctfd<br>      MARIADB_USER: ctfd<br>      MARIADB_PASSWORD: ctfd<br>      MARIADB_DATABASE: ctfd<br>      MARIADB_AUTO_UPGRADE: &quot;1&quot;<br>    volumes:<br>      - ./data/mysql:/var/lib/mysql<br>    command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --wait_timeout=28800, --log-warnings=0]<br><br>  cache:<br>    image: redis:4<br>    restart: always<br>    volumes:<br>      - ./data/redis:/data<br><br>networks:<br>  default:</pre><h3>Step 3: Prepare Volume Folders (persistent)</h3><pre>mkdir data db<br>sudo chmod -R 777 data db</pre><blockquote>NOTE:</blockquote><p>Later incase, you find that you can’t upload any files/logos/images, make sure you have given the permissions listed below:</p><pre>sudo mkdir -p data/uploads<br>sudo chmod -R 777 data/uploads<br><br>sudo mkdir -p data/logs<br>sudo chmod -R 777 data/logs<br><br>sudo chmod -R 777 data</pre><h3>Step 4: Start CTFd</h3><pre>sudo docker-compose up -d</pre><blockquote>Note:</blockquote><p>To see already running containers:</p><pre>sudo docker ps</pre><p>To close the running container:</p><pre>sudo docker-compose down -v</pre><p>To restart:</p><pre>sudo docker-compose restart</pre><p>Now visit:</p><pre>http://EC2_PUBLIC_IP</pre><p>You should see the CTFd setup page.</p><h3>7. Adding a Free Domain (Optional)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*TU9DXnvEmEHUFA6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A6-uZ5qftmJJtuA8" /></figure><p>For a temporary event, a free DuckDNS subdomain works well.</p><ol><li>Visit <strong>duckdns.org</strong></li><li>Create a subdomain (e.g., flagwars.duckdns.org)</li><li>Direct configuration-&gt; <a href="https://www.duckdns.org/update?domains=flagwars&amp;token=6f4bf8b2-45c2-447b-acbd-e157361b4453&amp;ip=100.53.250.68">https://www.duckdns.org/update?domains=&lt;your-domain-name&gt;&amp;token=&lt;account-token&gt;&amp;ip=&lt;</a>ec2-public-ip&gt;</li><li>Update the domain’s IP to your EC2 public IP</li><li>Test the domain in a browser</li></ol><h3>Enable HTTPS (Optional)</h3><p>If desired, use Certbot with Nginx for secure HTTPS. (Steps can be provided on request.)</p><h3>8. Initial CTFd Configuration</h3><p>Once CTFd is running:</p><ul><li>Create an admin account</li><li>Upload your event logo</li><li>Add challenges</li><li>Organize categories</li><li>Add hints, files, and flags</li><li>Configure scoreboard and settings</li><li>Test each challenge manually</li></ul><h3>9. Running the CTF Event</h3><p>On event day:</p><ul><li>Start your EC2 instance</li><li>Start Docker containers (docker-compose up -d)</li><li>Share your domain</li><li>Monitor logs and scoreboard</li></ul><p><strong>Important:</strong><br>Your laptop does <strong>not</strong> need to stay online.<br>AWS runs everything independently.</p><h3>10. Cleaning Up to Avoid Billing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Al5cGuInqJlHu1-.png" /></figure><p>Once the event ends:</p><h3>✔ Stop and Terminate EC2 Instance</h3><p>This deletes the server and its storage.</p><h3>✔ Release Elastic IP (if used)</h3><h3>✔ Delete any S3 buckets (only if manually created)</h3><h3>✔ Check AWS Billing</h3><p>Ensure there are no leftover resources.</p><p>After this process → <strong>you will not be billed</strong> under the free tier.</p><h3>11. Conclusion</h3><p>Hosting a CTF on AWS using CTFd is an excellent hands-on learning experience for cybersecurity beginners.<br>With an <strong>EC2 free-tier instance</strong>, <strong>Docker</strong>, and straightforward configuration, you can deploy a stable, scalable, and professional-grade CTF platform for your participants.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46306a8f2305" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>