You can create tasks if you run them concurrently:
async def run(port): async with serve(echo, "localhost", port): ... async def main(): async with asyncio.TaskGroup() as tg: for i in range(6): tg.create_task(run(20781 + i))