Add pasta of your choice to the Instant Pot. Add just enough water to cover the pasta.
Add salt (1 teaspoon per 4oz) and olive oil (1 tablespoon per 8oz) to the pasta water.
Set Instant Pot for time in the chart below for your selected pasta.
Once cook cycle is finished, allow pressure to naturally release for 2 minutes. Quick release remaining pressure.
Stir pasta well to absorb any remaining water.
If cooking with sauce...
Set the Instant Pot to saute mode and add a little bit of oil. Once hot, add 1 chopped onion and a pound of ground beef. Season well with salt and pepper.
Cook meat through and onion until translucent. Drain any grease.
Add a 24 oz can of spaghetti sauce (3 cups). To this, add 2 cups of water. Stir until combined.
Add spaghetti noodles into sauce mixture, making sure as many noodles are submerged as possible.
Set the Instant Pot to manual, 2 minutes. Once cycle is over, allow pressure to naturally release for 2 minutes before quick releasing any remaining pressure.
Stir spaghetti well.
Notes
If your Instant Pot spews water when releasing pressure, you can carefully set the pressure release valve back to sealed for a few seconds, then try to re-release (wearing some kind of glove to protect your hands). Adding extra oil to your pasta water before cooking can also prevent this from happening.
I don't recommend cooking gluten free pasta in an Instant Pot. However, whole wheat pasta works wonderfully; no need to adjust cooking times.
I use steamer baskets to cook multiple types of pasta (or even veggies) at once. Simply place them in the steamer basket, put that in your liner, and fill until there is just enough water to cover it all. Give it that salt/olive oil shake, lock your lid on, and set for a lower time, since there is more water and pasta.
Follow this chart for estimated pasta cooking times: