There are some TF2 servers that have sv_cheats set to 1, which means that you can do a lot of commands in a multiplayer server.
Use the 'Create a Server' button at the end of the 'Find a Game' selection screen. At the top of the HUD will be a 'ready up' screen, and this for some reason will persist and stay no matter how many times you hit 'f4'. Keep in mind that this method is a bit buggy if you're switching to some maps, as the game will register you as playing in competitive mode. Open up the developer console and type in map id(id should be replaced with your map name, like cp_degroot keep, cp_cloak or arena_watchtower Ex: map cp_cloak). You can use the second method after starting a training match to flip between different maps whenever you like. This creates a server for you, and sets the server settings to that of a normal tf2 match. Start a training match via the game's 'find a game' selection screen. Don't worry, the server will close once the host leaves, it's not an open public community server, unless you explicitly change the settings of the server to be that way, and yes you can have your friends join the server if you use the invite function through Steam's friend menu. There are multiple ways to freely and quickly create a tf2 server.