The long-term preservation method of boiled peanuts is to keep the taste and soak in the original juice. You can cook them separately from the seasoning water. Don't put green onions when cooking seasoning water (putting green onions is the easiest way to spoil seasoning water). Just boil peanuts in white water. Let the seasoning water cool naturally and then put it in. Don't touch peanuts in seasoning water directly with your hands.
Generally, boiled peanuts can only be preserved for 2-3 days at room temperature. You can drain the boiled peanuts, seal them with plastic wrap and put them in the refrigerator for about 7 days.